48 #define DEBUG_TYPE "livedebug"
54 STATISTIC(NumInsertedDebugValues,
"Number of DBG_VALUEs inserted");
58 "Debug Variable Analysis",
false,
false)
64 void LiveDebugVariables::getAnalysisUsage(
AnalysisUsage &AU)
const {
81 class UserValueScopes {
93 LS.getMachineBasicBlocks(
DL, LBlocks);
94 if (LBlocks.count(MBB) != 0 ||
LS.dominates(
DL, MBB))
131 void coalesceLocation(
unsigned LocNo);
144 UserValue(
const MDNode *var,
const MDNode *expr,
unsigned o,
bool i,
146 : Variable(var), Expression(expr), offset(o), IsIndirect(i), dl(L),
147 leader(this), next(nullptr), locInts(alloc) {}
150 UserValue *getLeader() {
151 UserValue *l = leader;
152 while (l != l->leader)
158 UserValue *getNext()
const {
return next; }
162 unsigned Offset,
bool indirect)
const {
163 return Var == Variable && Expr == Expression && dl->getInlinedAt() == IA &&
164 Offset == offset && indirect == IsIndirect;
168 static UserValue *
merge(UserValue *L1, UserValue *L2) {
169 L2 = L2->getLeader();
172 L1 = L1->getLeader();
178 End->leader = L1, End = End->next;
180 End->next = L1->next;
191 for (
unsigned i = 0, e = locations.size(); i != e; ++i)
192 if (locations[i].
isReg() &&
193 locations[i].getReg() == LocMO.
getReg() &&
194 locations[i].getSubReg() == LocMO.
getSubReg())
197 for (
unsigned i = 0, e = locations.size(); i != e; ++i)
200 locations.push_back(LocMO);
202 locations.back().clearParent();
204 if (locations.back().isReg())
205 locations.back().setIsUse();
206 return locations.size() - 1;
210 void mapVirtRegs(LDVImpl *LDV);
234 void extendDef(
SlotIndex Idx,
unsigned LocNo,
238 UserValueScopes &UVS);
247 void addDefsFromCopies(
LiveInterval *LI,
unsigned LocNo,
257 UserValueScopes &UVS);
273 DebugLoc getDebugLoc() {
return dl;}
299 VRMap virtRegToEqClass;
306 UserValue *getUserValue(
const MDNode *Var,
const MDNode *Expr,
307 unsigned Offset,
bool IsIndirect,
DebugLoc DL);
310 UserValue *lookupVirtReg(
unsigned VirtReg);
326 void computeIntervals();
337 virtRegToEqClass.clear();
340 assert((!ModifiedMF || EmitDone) &&
341 "Dbg values are not emitted in LDV");
348 void mapVirtReg(
unsigned VirtReg, UserValue *EC);
365 auto *Scope = cast<DIScope>(DL.
getScope());
367 CommentOS << Scope->getFilename();
368 CommentOS <<
':' << DL.
getLine();
370 CommentOS <<
':' << DL.
getCol();
386 OS << Res <<
"," << V->
getLine();
387 if (
auto *InlinedAt = DL->getInlinedAt()) {
388 if (
DebugLoc InlinedAtDL = InlinedAt) {
397 auto *DV = cast<DILocalVariable>(Variable);
405 OS <<
" [" << I.
start() <<
';' << I.
stop() <<
"):";
406 if (I.
value() == ~0u)
411 for (
unsigned i = 0, e = locations.size(); i != e; ++i) {
412 OS <<
" Loc" << i <<
'=';
413 locations[i].print(OS, TRI);
419 OS <<
"********** DEBUG VARIABLES **********\n";
420 for (
unsigned i = 0, e = userValues.size(); i != e; ++i)
421 userValues[i]->print(OS, TRI);
424 void UserValue::coalesceLocation(
unsigned LocNo) {
425 unsigned KeepLoc = 0;
426 for (
unsigned e = locations.size(); KeepLoc != e; ++KeepLoc) {
427 if (KeepLoc == LocNo)
429 if (locations[KeepLoc].isIdenticalTo(locations[LocNo]))
433 if (KeepLoc == locations.size())
437 unsigned EraseLoc = LocNo;
438 if (KeepLoc > EraseLoc)
440 locations.erase(locations.begin() + EraseLoc);
444 unsigned v = I.
value();
447 else if (v > EraseLoc)
452 void UserValue::mapVirtRegs(LDVImpl *LDV) {
453 for (
unsigned i = 0, e = locations.size(); i != e; ++i)
454 if (locations[i].
isReg() &&
456 LDV->mapVirtReg(locations[i].getReg(),
this);
459 UserValue *LDVImpl::getUserValue(
const MDNode *Var,
const MDNode *Expr,
460 unsigned Offset,
bool IsIndirect,
462 UserValue *&Leader = userVarMap[Var];
464 UserValue *UV = Leader->getLeader();
466 for (; UV; UV = UV->getNext())
467 if (UV->match(Var, Expr, DL->getInlinedAt(), Offset, IsIndirect))
471 userValues.push_back(
472 make_unique<UserValue>(Var, Expr, Offset, IsIndirect, DL, allocator));
473 UserValue *UV = userValues.back().get();
478 void LDVImpl::mapVirtReg(
unsigned VirtReg, UserValue *EC) {
480 UserValue *&Leader = virtRegToEqClass[VirtReg];
484 UserValue *LDVImpl::lookupVirtReg(
unsigned VirtReg) {
485 if (UserValue *UV = virtRegToEqClass.lookup(VirtReg))
486 return UV->getLeader();
506 getUserValue(Var, Expr, Offset, IsIndirect, MI->
getDebugLoc());
512 bool Changed =
false;
518 if (!MBBI->isDebugValue()) {
524 LIS->getMBBStartIdx(MBB) :
525 LIS->getInstructionIndex(std::prev(MBBI)).getRegSlot();
528 if (handleDebugValue(MBBI, Idx)) {
529 MBBI = MBB->
erase(MBBI);
533 }
while (MBBI != MBBE && MBBI->isDebugValue());
539 void UserValue::extendDef(
SlotIndex Idx,
unsigned LocNo,
543 UserValueScopes &UVS) {
556 if (!Segment || Segment->valno != VNI) {
561 if (Segment->end < Stop)
562 Stop = Segment->end, ToEnd =
false;
569 if (I.
value() != LocNo || I.
stop() != Start)
577 Stop = I.
start(), ToEnd =
false;
579 else if (!ToEnd && Kills)
585 I.
insert(Start, Stop, LocNo);
590 const std::vector<MachineDomTreeNode*> &Children =
592 for (
unsigned i = 0, e = Children.size(); i != e; ++i) {
594 if (UVS.dominates(MBB))
597 }
while (!Todo.
empty());
601 UserValue::addDefsFromCopies(
LiveInterval *LI,
unsigned LocNo,
616 if (MO.getSubReg() || !MI->
isCopy())
638 assert(DstVNI && DstVNI->
def == Idx.
getRegSlot() &&
"Bad copy value");
639 CopyValues.
push_back(std::make_pair(DstLI, DstVNI));
642 if (CopyValues.
empty())
645 DEBUG(
dbgs() <<
"Got " << CopyValues.
size() <<
" copies of " << *LI <<
'\n');
648 for (
unsigned i = 0, e = Kills.
size(); i != e; ++i) {
650 for (
unsigned j = 0, e = CopyValues.
size(); j != e; ++j) {
652 const VNInfo *DstVNI = CopyValues[j].second;
659 DEBUG(
dbgs() <<
"Kill at " << Idx <<
" covered by valno #"
660 << DstVNI->
id <<
" in " << *DstLI <<
'\n');
662 assert(CopyMI && CopyMI->
isCopy() &&
"Bad copy value");
663 unsigned LocNo = getLocationNo(CopyMI->
getOperand(0));
665 NewDefs.push_back(std::make_pair(Idx, LocNo));
676 UserValueScopes &UVS) {
681 if (I.
value() != ~0u)
685 for (
unsigned i = 0; i != Defs.
size(); ++i) {
687 unsigned LocNo = Defs[i].second;
691 extendDef(Idx, LocNo,
nullptr,
nullptr,
nullptr, LIS, MDT, UVS);
698 const VNInfo *VNI =
nullptr;
704 extendDef(Idx, LocNo, LI, VNI, &Kills, LIS, MDT, UVS);
706 addDefsFromCopies(LI, LocNo, Kills, Defs, MRI, LIS);
713 const VNInfo *VNI = LR->getVNInfoAt(Idx);
715 extendDef(Idx, LocNo, LR, VNI,
nullptr, LIS, MDT, UVS);
720 if (I.
value() == ~0u)
726 void LDVImpl::computeIntervals() {
727 for (
unsigned i = 0, e = userValues.size(); i != e; ++i) {
728 UserValueScopes UVS(userValues[i]->getDebugLoc(),
LS);
729 userValues[i]->computeIntervals(MF->getRegInfo(), *TRI, *LIS, *MDT, UVS);
730 userValues[i]->mapVirtRegs(
this);
741 DEBUG(
dbgs() <<
"********** COMPUTING LIVE DEBUG VARIABLES: "
742 << mf.
getName() <<
" **********\n");
747 ModifiedMF = Changed;
753 for (
auto MBBI = MBB.
begin(), MBBE = MBB.
end(); MBBI != MBBE; ) {
754 if (!MBBI->isDebugValue()) {
758 MBBI = MBB.
erase(MBBI);
771 pImpl =
new LDVImpl(
this);
772 return static_cast<LDVImpl*
>(pImpl)->runOnMachineFunction(mf);
775 void LiveDebugVariables::releaseMemory() {
777 static_cast<LDVImpl*
>(pImpl)->clear();
782 delete static_cast<LDVImpl*
>(pImpl);
793 dbgs() <<
"Splitting Loc" << OldLocNo <<
'\t';
794 print(
dbgs(),
nullptr);
796 bool DidChange =
false;
799 for (
unsigned i = 0; i != NewRegs.
size(); ++i) {
805 unsigned NewLocNo = ~0u;
809 if (!LocMapI.
valid())
813 while (LocMapI.
valid() && LII != LIE) {
820 if (LocMapI.
value() == OldLocNo && LII->start < LocMapI.
stop()) {
822 if (NewLocNo == ~0u) {
824 MO.
setSubReg(locations[OldLocNo].getSubReg());
825 NewLocNo = getLocationNo(MO);
833 if (LStart < LII->start)
835 if (LStop > LII->end)
842 if (LStart < LocMapI.
start()) {
845 assert(LocMapI.
valid() &&
"Unexpected coalescing");
847 if (LStop > LocMapI.
stop()) {
849 LocMapI.
insert(LII->end, LStop, OldLocNo);
855 if (LII->end < LocMapI.
stop()) {
861 if (!LocMapI.
valid())
869 locations.erase(locations.begin() + OldLocNo);
871 while (LocMapI.
valid()) {
872 unsigned v = LocMapI.
value();
875 << LocMapI.
stop() <<
")\n");
884 DEBUG({
dbgs() <<
"Split result: \t"; print(
dbgs(),
nullptr);});
891 bool DidChange =
false;
894 for (
unsigned i = locations.size(); i ; --i) {
895 unsigned LocNo = i-1;
899 DidChange |= splitLocation(LocNo, NewRegs, LIS);
905 bool DidChange =
false;
906 for (UserValue *UV = lookupVirtReg(OldReg); UV; UV = UV->getNext())
907 DidChange |= UV->splitRegister(OldReg, NewRegs, *LIS);
913 UserValue *UV = lookupVirtReg(OldReg);
914 for (
unsigned i = 0; i != NewRegs.
size(); ++i)
915 mapVirtReg(NewRegs[i], UV);
921 static_cast<LDVImpl*
>(pImpl)->
splitRegister(OldReg, NewRegs);
927 for (
unsigned i = locations.size(); i ; --i) {
928 unsigned LocNo = i-1;
934 unsigned VirtReg = Loc.
getReg();
948 coalesceLocation(LocNo);
982 ++NumInsertedDebugValues;
984 assert(cast<DILocalVariable>(Variable)
985 ->isValidLocationForIntrinsic(getDebugLoc()) &&
986 "Expected inlined-at fields to agree");
989 IsIndirect, Loc.
getReg(), offset, Variable, Expression);
1005 unsigned LocNo = I.value();
1006 DEBUG(
dbgs() <<
"\t[" << Start <<
';' << Stop <<
"):" << LocNo);
1010 DEBUG(
dbgs() <<
" BB#" << MBB->getNumber() <<
'-' << MBBEnd);
1011 insertDebugValue(MBB, Start, LocNo, LIS, TII);
1014 while(Stop > MBBEnd) {
1020 DEBUG(
dbgs() <<
" BB#" << MBB->getNumber() <<
'-' << MBBEnd);
1021 insertDebugValue(MBB, Start, LocNo, LIS, TII);
1031 void LDVImpl::emitDebugValues(
VirtRegMap *VRM) {
1032 DEBUG(
dbgs() <<
"********** EMITTING LIVE DEBUG VARIABLES **********\n");
1036 for (
unsigned i = 0, e = userValues.size(); i != e; ++i) {
1037 DEBUG(userValues[i]->print(
dbgs(), TRI));
1038 userValues[i]->rewriteLocations(*VRM, *TRI);
1039 userValues[i]->emitDebugValues(VRM, *LIS, *TII);
1049 bool LiveDebugVariables::doInitialization(
Module &M) {
1057 static_cast<LDVImpl*
>(pImpl)->
print(
dbgs());
static bool isReg(const MCInst &MI, unsigned OpNo)
void setValueUnchecked(ValT x)
setValueUnchecked - Change the mapped value of the current interval without checking for coalescing...
const MachineInstrBuilder & addMetadata(const MDNode *MD) const
void push_back(const T &Elt)
void setValue(ValT x)
setValue - Change the mapped value of the current interval.
const Segment * getSegmentContaining(SlotIndex Idx) const
Return the segment that contains the specified index, or null if there is none.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Segments::iterator iterator
SlotIndex def
The index of the defining instruction.
STATISTIC(NumFunctions,"Total number of functions")
MDNode * getScope() const
MachineFunction & getMachineFunction() const
A Module instance is used to store all the information related to an LLVM module. ...
SlotIndex getBaseIndex() const
Returns the base index for associated with this index.
static void printDebugLoc(DebugLoc DL, raw_ostream &CommentOS, const LLVMContext &Ctx)
const DIExpression * getDebugExpression() const
Return the complex address expression referenced by this DBG_VALUE instruction.
LiveInterval - This class represents the liveness of a register, or stack slot.
iterator getFirstTerminator()
getFirstTerminator - returns an iterator to the first terminator instruction of this basic block...
void initializeLiveDebugVariablesPass(PassRegistry &)
SlotIndex getInstructionIndex(const MachineInstr *instr) const
Returns the base index of the given instruction.
static bool isVirtualRegister(unsigned Reg)
isVirtualRegister - Return true if the specified register number is in the virtual register namespace...
iterator advanceTo(iterator I, SlotIndex Pos)
advanceTo - Advance the specified iterator to point to the Segment containing the specified position...
MachineBasicBlock * getMBBFromIndex(SlotIndex index) const
SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const
Return the last index in the given basic block.
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
void setMap(const IntervalMap &m)
setMap - Change the map iterated over.
VNInfo - Value Number Information.
bool isMetadata() const
isMetadata - Tests if this is a MO_Metadata operand.
VNInfo * getVNInfoAt(SlotIndex Idx) const
getVNInfoAt - Return the VNInfo that is live at Idx, or NULL.
bool isTerminator(QueryType Type=AnyInBundle) const
Returns true if this instruction part of the terminator for a basic block.
This class represents the liveness of a register, stack slot, etc.
bool match(Val *V, const Pattern &P)
#define INITIALIZE_PASS_DEPENDENCY(depName)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
~LiveDebugVariables() override
void emitDebugValues(VirtRegMap *VRM)
emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes that happened during registe...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false)
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void advanceTo(KeyT x)
advanceTo - Move to the first interval with stop >= x, or end().
RecyclingAllocator - This class wraps an Allocator, adding the functionality of recycling deleted obj...
StringRef getName() const
const MachineInstrBuilder & addImm(int64_t Val) const
addImm - Add a new immediate operand.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
void erase()
erase - Erase the current interval.
size_t size() const
size - Get the array size.
SlotIndex getPrevIndex() const
Returns the previous index.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
void setStartUnchecked(KeyT a)
setStartUnchecked - Move the start of the current interval without checking for coalescing or overlap...
const MachineBasicBlock * getParent() const
TargetInstrInfo - Interface to description of machine instruction set.
DBG_VALUE - a mapping of the llvm.dbg.value intrinsic.
initializer< Ty > init(const Ty &Val)
const KeyT & start() const
start - Return the beginning of the current interval.
iterator SkipPHIsAndLabels(iterator I)
SkipPHIsAndLabels - Return the first instruction in MBB after I that is not a PHI or a label...
iterator_range< use_nodbg_iterator > use_nodbg_operands(unsigned Reg) const
static void removeDebugValues(MachineFunction &mf)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
This is an important class for using LLVM in a threaded context.
bool isIndirectDebugValue() const
A DBG_VALUE is indirect iff the first operand is a register and the second operand is an immediate...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
void find(KeyT x)
find - Move to the first interval with stop >= x, or end().
bundle_iterator - MachineBasicBlock iterator that automatically skips over MIs that are inside bundle...
const MachineOperand & getOperand(unsigned i) const
Two Address instruction pass
void goToBegin()
goToBegin - Move to the first interval in map.
Represent the analysis usage information of a pass.
void substPhysReg(unsigned Reg, const TargetRegisterInfo &)
substPhysReg - Substitute the current register with the physical register Reg, taking any existing Su...
const std::vector< DomTreeNodeBase< NodeT > * > & getChildren() const
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
unsigned getSubReg() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
DILocation * getInlinedAt() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
unsigned id
The ID number of this value.
IntervalMap< SlotIndex, unsigned, 4 > LocMap
LocMap - Map of where a user value is live, and its location.
const DILocalVariable * getDebugVariable() const
Return the debug variable referenced by this DBG_VALUE instruction.
INITIALIZE_PASS_BEGIN(LiveDebugVariables,"livedebugvars","Debug Variable Analysis", false, false) INITIALIZE_PASS_END(LiveDebugVariables
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void splitRegister(unsigned OldReg, ArrayRef< unsigned > NewRegs, LiveIntervals &LIS)
splitRegister - Move any user variables in OldReg to the live ranges in NewRegs where they are live...
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LiveInterval & getInterval(unsigned Reg)
bool valid() const
valid - Return true if the current position is valid, false for end().
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static void collectDebugValues(MachineInstr *MI, SmallVectorImpl< MachineInstr * > &DbgValues)
collectDebgValues - Scan instructions following MI and collect any matching DBG_VALUEs.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const KeyT & stop() const
stop - Return the end of the current interval.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
SlotIndex beginIndex() const
beginIndex - Return the lowest numbered slot covered.
void insert(KeyT a, KeyT b, ValT y)
insert - Insert mapping [a;b] -> y before the current position.
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
isPhysicalRegister - Return true if the specified register number is in the physical register namespa...
static void printExtendedName(raw_ostream &OS, const DILocalVariable *V, const DILocation *DL)
LexicalScopes - This class provides interface to collect and use lexical scoping information from mac...
void setReg(unsigned Reg)
Change the register this operand corresponds to.
static cl::opt< bool > EnableLDV("live-debug-variables", cl::init(true), cl::desc("Enable the live debug variables pass"), cl::Hidden)
void setSubReg(unsigned subReg)
LLVMContext & getContext() const
bool hasInterval(unsigned Reg) const
bool isAssignedReg(unsigned virtReg) const
returns true if the specified virtual register is not mapped to a stack slot or rematerialized.
SlotIndex getRegSlot(bool EC=false) const
Returns the register use/def slot in the current instruction for a normal or early-clobber def...
std::vector< uint8_t > Unit
unsigned getReg() const
getReg - Returns the register number.
void setStopUnchecked(KeyT b)
setStopUnchecked - Move the end of the current interval without checking for coalescing or overlaps...
DenseMap< const Function *, DISubprogram * > makeSubprogramMap(const Module &M)
int getStackSlot(unsigned virtReg) const
returns the stack slot mapped to the specified virtual register
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
MachineInstr * getInstructionFromIndex(SlotIndex index) const
Returns the instruction associated with the given index.
BasicBlockListType::iterator iterator
This class implements an extremely fast bulk output stream that can only output to a stream...
SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const
Return the first index in the given basic block.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
unsigned getPhys(unsigned virtReg) const
returns the physical register mapped to the specified virtual register
virtual void print(raw_ostream &O, const Module *M) const
print - Print out the internal state of the pass.
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
const ValT & value() const
value - Return the mapped value at the current interval.
bool isIdenticalTo(const MachineOperand &Other) const
isIdenticalTo - Return true if this operand is identical to the specified operand.
static MachineBasicBlock::iterator findInsertLocation(MachineBasicBlock *MBB, SlotIndex Idx, LiveIntervals &LIS)
findInsertLocation - Find an iterator for inserting a DBG_VALUE instruction.
SlotIndex getNextSlot() const
Returns the next slot in the index list.
SlotIndex - An opaque wrapper around machine indexes.
static MachineOperand CreateFI(int Idx)
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
LiveRange & getRegUnit(unsigned Unit)
getRegUnit - Return the live range for Unit.
void dump()
dump - Print data structures to dbgs().
bool empty() const
empty - Check if the string is empty.