diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-19 20:40:05 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-19 20:40:05 +0000 |
commit | 41716328c597656692f2189f47c7cc56120d2aa5 (patch) | |
tree | 50c2066681216e27a4eb563747e219ae47273496 /lib | |
parent | 80b13b31a80b54768abc2da9f00a725209702816 (diff) | |
download | external_llvm-41716328c597656692f2189f47c7cc56120d2aa5.zip external_llvm-41716328c597656692f2189f47c7cc56120d2aa5.tar.gz external_llvm-41716328c597656692f2189f47c7cc56120d2aa5.tar.bz2 |
Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 116 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 34 |
2 files changed, 75 insertions, 75 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 78cbad8..5d275dd 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -71,7 +71,7 @@ bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel) { DIDescriptor::DIDescriptor(MDNode *N, unsigned RequiredTag) { DbgNode = N; - + // If this is non-null, check to see if the Tag matches. If not, set to null. if (N && getTag() != RequiredTag) { DbgNode = 0; @@ -84,28 +84,28 @@ DIDescriptor::getStringField(unsigned Elt, std::string &Result) const { if (DbgNode == 0) return Result; - if (Elt < DbgNode->getNumElements()) + if (Elt < DbgNode->getNumElements()) if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode->getElement(Elt))) { Result.assign(MDS->begin(), MDS->begin() + MDS->length()); return Result; } - + return Result; } uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const { - if (DbgNode == 0) + if (DbgNode == 0) return 0; if (Elt < DbgNode->getNumElements()) if (ConstantInt *CI = dyn_cast<ConstantInt>(DbgNode->getElement(Elt))) return CI->getZExtValue(); - + return 0; } DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { - if (DbgNode == 0) + if (DbgNode == 0) return DIDescriptor(); if (Elt < DbgNode->getNumElements() && DbgNode->getElement(Elt)) @@ -115,7 +115,7 @@ DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { } GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const { - if (DbgNode == 0) + if (DbgNode == 0) return 0; if (Elt < DbgNode->getNumElements()) @@ -132,7 +132,7 @@ GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const { bool DIDescriptor::isBasicType() const { assert (!isNull() && "Invalid descriptor!"); unsigned Tag = getTag(); - + return Tag == dwarf::DW_TAG_base_type; } @@ -197,7 +197,7 @@ bool DIDescriptor::isVariable() const { bool DIDescriptor::isSubprogram() const { assert (!isNull() && "Invalid descriptor!"); unsigned Tag = getTag(); - + return Tag == dwarf::DW_TAG_subprogram; } @@ -210,7 +210,7 @@ bool DIDescriptor::isGlobalVariable() const { return Tag == dwarf::DW_TAG_variable; } -/// isScope - Return true if the specified tag is one of the scope +/// isScope - Return true if the specified tag is one of the scope /// related tag. bool DIDescriptor::isScope() const { assert (!isNull() && "Invalid descriptor!"); @@ -273,10 +273,10 @@ void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) { /// Verify - Verify that a compile unit is well formed. bool DICompileUnit::Verify() const { - if (isNull()) + if (isNull()) return false; std::string Res; - if (getFilename(Res).empty()) + if (getFilename(Res).empty()) return false; // It is possible that directory and produce string is empty. return true; @@ -284,26 +284,26 @@ bool DICompileUnit::Verify() const { /// Verify - Verify that a type descriptor is well formed. bool DIType::Verify() const { - if (isNull()) + if (isNull()) return false; - if (getContext().isNull()) + if (getContext().isNull()) return false; DICompileUnit CU = getCompileUnit(); - if (!CU.isNull() && !CU.Verify()) + if (!CU.isNull() && !CU.Verify()) return false; return true; } /// Verify - Verify that a composite type descriptor is well formed. bool DICompositeType::Verify() const { - if (isNull()) + if (isNull()) return false; - if (getContext().isNull()) + if (getContext().isNull()) return false; DICompileUnit CU = getCompileUnit(); - if (!CU.isNull() && !CU.Verify()) + if (!CU.isNull() && !CU.Verify()) return false; return true; } @@ -312,12 +312,12 @@ bool DICompositeType::Verify() const { bool DISubprogram::Verify() const { if (isNull()) return false; - + if (getContext().isNull()) return false; DICompileUnit CU = getCompileUnit(); - if (!CU.Verify()) + if (!CU.Verify()) return false; DICompositeType Ty = getType(); @@ -330,12 +330,12 @@ bool DISubprogram::Verify() const { bool DIGlobalVariable::Verify() const { if (isNull()) return false; - + if (getContext().isNull()) return false; DICompileUnit CU = getCompileUnit(); - if (!CU.isNull() && !CU.Verify()) + if (!CU.isNull() && !CU.Verify()) return false; DIType Ty = getType(); @@ -352,7 +352,7 @@ bool DIGlobalVariable::Verify() const { bool DIVariable::Verify() const { if (isNull()) return false; - + if (getContext().isNull()) return false; @@ -420,14 +420,14 @@ void DIType::dump() const { // TODO : Print context getCompileUnit().dump(); - errs() << " [" - << getLineNumber() << ", " + errs() << " [" + << getLineNumber() << ", " << getSizeInBits() << ", " << getAlignInBits() << ", " - << getOffsetInBits() + << getOffsetInBits() << "] "; - if (isPrivate()) + if (isPrivate()) errs() << " [private] "; else if (isProtected()) errs() << " [protected] "; @@ -538,7 +538,7 @@ void DIVariable::dump() const { //===----------------------------------------------------------------------===// DIFactory::DIFactory(Module &m) - : M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0), + : M(m), VMContext(M.getContext()), StopPointFn(0), FuncStartFn(0), RegionStartFn(0), RegionEndFn(0), DeclareFn(0) { EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext)); @@ -554,11 +554,11 @@ Constant *DIFactory::GetTagConstant(unsigned TAG) { // DIFactory: Primary Constructors //===----------------------------------------------------------------------===// -/// GetOrCreateArray - Create an descriptor for an array of descriptors. +/// GetOrCreateArray - Create an descriptor for an array of descriptors. /// This implicitly uniques the arrays created. DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) { SmallVector<Value*, 16> Elts; - + if (NumTys == 0) Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext))); else @@ -576,7 +576,7 @@ DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) { ConstantInt::get(Type::getInt64Ty(VMContext), Lo), ConstantInt::get(Type::getInt64Ty(VMContext), Hi) }; - + return DISubrange(MDNode::get(VMContext, &Elts[0], 3)); } @@ -705,7 +705,7 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag, /// CreateSubprogram - Create a new descriptor for the specified subprogram. /// See comments in DISubprogram for descriptions of these fields. This /// method does not unique the generated descriptors. -DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, +DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, const std::string &Name, const std::string &DisplayName, const std::string &LinkageName, @@ -738,7 +738,7 @@ DIFactory::CreateGlobalVariable(DIDescriptor Context, const std::string &Name, DICompileUnit CompileUnit, unsigned LineNo, DIType Type,bool isLocalToUnit, bool isDefinition, llvm::GlobalVariable *Val) { - Value *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_variable), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), Context.getNode(), @@ -792,7 +792,7 @@ DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context) { } /// CreateLocation - Creates a debug info location. -DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo, +DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo, DIScope S, DILocation OrigLoc) { Value *Elts[] = { ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), @@ -812,12 +812,12 @@ DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo, /// inserting it at the end of the specified basic block. void DIFactory::InsertStopPoint(DICompileUnit CU, unsigned LineNo, unsigned ColNo, BasicBlock *BB) { - + // Lazily construct llvm.dbg.stoppoint function. if (!StopPointFn) - StopPointFn = llvm::Intrinsic::getDeclaration(&M, + StopPointFn = llvm::Intrinsic::getDeclaration(&M, llvm::Intrinsic::dbg_stoppoint); - + // Invoke llvm.dbg.stoppoint Value *Args[] = { ConstantInt::get(llvm::Type::getInt32Ty(VMContext), LineNo), @@ -833,7 +833,7 @@ void DIFactory::InsertSubprogramStart(DISubprogram SP, BasicBlock *BB) { // Lazily construct llvm.dbg.func.start. if (!FuncStartFn) FuncStartFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_func_start); - + // Call llvm.dbg.func.start which also implicitly sets a stoppoint. CallInst::Create(FuncStartFn, SP.getNode(), "", BB); } @@ -864,7 +864,7 @@ void DIFactory::InsertRegionEnd(DIDescriptor D, BasicBlock *BB) { void DIFactory::InsertDeclare(Value *Storage, DIVariable D, BasicBlock *BB) { // Cast the storage to a {}* for the call to llvm.dbg.declare. Storage = new BitCastInst(Storage, EmptyStructPtr, "", BB); - + if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); @@ -909,7 +909,7 @@ void DebugInfoFinder::processModule(Module &M) { } } } - + /// processType - Process DIType. void DebugInfoFinder::processType(DIType DT) { if (!addType(DT)) @@ -926,12 +926,12 @@ void DebugInfoFinder::processType(DIType DT) { DIType TypeE = DIType(D.getNode()); if (!TypeE.isNull()) processType(TypeE); - else + else processSubprogram(DISubprogram(D.getNode())); } } else if (DT.isDerivedType()) { DIDerivedType DDT(DT.getNode()); - if (!DDT.isNull()) + if (!DDT.isNull()) processType(DDT.getTypeDerivedFrom()); } } @@ -1006,7 +1006,7 @@ bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) { CUs.push_back(CU.getNode()); return true; } - + /// addGlobalVariable - Add global variable into GVs. bool DebugInfoFinder::addGlobalVariable(DIGlobalVariable DIG) { if (DIG.isNull()) @@ -1023,7 +1023,7 @@ bool DebugInfoFinder::addGlobalVariable(DIGlobalVariable DIG) { bool DebugInfoFinder::addSubprogram(DISubprogram SP) { if (SP.isNull()) return false; - + if (!NodesSeen.insert(SP.getNode())) return false; @@ -1083,7 +1083,7 @@ namespace llvm { NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv"); if (!NMD) return 0; - + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { DIGlobalVariable DIG(cast_or_null<MDNode>(NMD->getElement(i))); if (DIG.isNull()) @@ -1150,28 +1150,28 @@ namespace llvm { return true; } - /// isValidDebugInfoIntrinsic - Return true if SPI is a valid debug + /// isValidDebugInfoIntrinsic - Return true if SPI is a valid debug /// info intrinsic. - bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI, + bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI, CodeGenOpt::Level OptLev) { return DIDescriptor::ValidDebugInfo(SPI.getContext(), OptLev); } - /// isValidDebugInfoIntrinsic - Return true if FSI is a valid debug + /// isValidDebugInfoIntrinsic - Return true if FSI is a valid debug /// info intrinsic. bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI, CodeGenOpt::Level OptLev) { return DIDescriptor::ValidDebugInfo(FSI.getSubprogram(), OptLev); } - /// isValidDebugInfoIntrinsic - Return true if RSI is a valid debug + /// isValidDebugInfoIntrinsic - Return true if RSI is a valid debug /// info intrinsic. bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI, CodeGenOpt::Level OptLev) { return DIDescriptor::ValidDebugInfo(RSI.getContext(), OptLev); } - /// isValidDebugInfoIntrinsic - Return true if REI is a valid debug + /// isValidDebugInfoIntrinsic - Return true if REI is a valid debug /// info intrinsic. bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI, CodeGenOpt::Level OptLev) { @@ -1179,14 +1179,14 @@ namespace llvm { } - /// isValidDebugInfoIntrinsic - Return true if DI is a valid debug + /// isValidDebugInfoIntrinsic - Return true if DI is a valid debug /// info intrinsic. bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI, CodeGenOpt::Level OptLev) { return DIDescriptor::ValidDebugInfo(DI.getVariable(), OptLev); } - /// ExtractDebugLocation - Extract debug location information + /// ExtractDebugLocation - Extract debug location information /// from llvm.dbg.stoppoint intrinsic. DebugLoc ExtractDebugLocation(DbgStopPointInst &SPI, DebugLocTracker &DebugLocInfo) { @@ -1194,7 +1194,7 @@ namespace llvm { Value *Context = SPI.getContext(); // If this location is already tracked then use it. - DebugLocTuple Tuple(cast<MDNode>(Context), SPI.getLine(), + DebugLocTuple Tuple(cast<MDNode>(Context), SPI.getLine(), SPI.getColumn()); DenseMap<DebugLocTuple, unsigned>::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); @@ -1205,11 +1205,11 @@ namespace llvm { unsigned Id = DebugLocInfo.DebugLocations.size(); DebugLocInfo.DebugLocations.push_back(Tuple); DebugLocInfo.DebugIdMap[Tuple] = Id; - + return DebugLoc::get(Id); } - /// ExtractDebugLocation - Extract debug location information + /// ExtractDebugLocation - Extract debug location information /// from DILocation. DebugLoc ExtractDebugLocation(DILocation &Loc, DebugLocTracker &DebugLocInfo) { @@ -1228,11 +1228,11 @@ namespace llvm { unsigned Id = DebugLocInfo.DebugLocations.size(); DebugLocInfo.DebugLocations.push_back(Tuple); DebugLocInfo.DebugIdMap[Tuple] = Id; - + return DebugLoc::get(Id); } - /// ExtractDebugLocation - Extract debug location information + /// ExtractDebugLocation - Extract debug location information /// from llvm.dbg.func_start intrinsic. DebugLoc ExtractDebugLocation(DbgFuncStartInst &FSI, DebugLocTracker &DebugLocInfo) { @@ -1254,7 +1254,7 @@ namespace llvm { unsigned Id = DebugLocInfo.DebugLocations.size(); DebugLocInfo.DebugLocations.push_back(Tuple); DebugLocInfo.DebugIdMap[Tuple] = Id; - + return DebugLoc::get(Id); } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 750f3cb..98423dd 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -150,7 +150,7 @@ class VISIBILITY_HIDDEN DbgScope { SmallVector<DbgScope *, 4> Scopes; // Scopes defined in scope. SmallVector<DbgVariable *, 8> Variables;// Variables declared in scope. SmallVector<DbgConcreteScope *, 8> ConcreteInsts;// Concrete insts of funcs. - + // Private state for dump() mutable unsigned IndentLevel; public: @@ -232,7 +232,7 @@ DbgScope::~DbgScope() { DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T) : Dwarf(OS, A, T, "dbg"), ModuleCU(0), AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), - ValuesSet(InitValuesSetSize), Values(), StringPool(), + ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionSourceLines(), didInitial(false), shouldEmit(false), FunctionDbgScope(0), DebugTimer(0) { if (TimePassesIsEnabled) @@ -593,7 +593,7 @@ DIType DwarfDebug::GetBlockByrefType(DIType Ty, std::string Name) { the variable's Debug Information Entry as its real type. So far, so good. However now the debugger will expect the variable VarName to have the type SomeType. So we need the location attribute for the variable to be an - expression that explains to the debugger how to navigate through the + expression that explains to the debugger how to navigate through the pointers and struct to find the actual variable of type SomeType. The following function does just that. We start by getting @@ -639,7 +639,7 @@ DIType DwarfDebug::GetBlockByrefType(DIType Ty, std::string Name) { /// starting location. Add the DWARF information to the die. For /// more information, read large comment just above here. /// -void DwarfDebug::AddBlockByrefAddress(DbgVariable *&DV, DIE *Die, +void DwarfDebug::AddBlockByrefAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute, const MachineLocation &Location) { const DIVariable &VD = DV->getVariable(); @@ -667,7 +667,7 @@ void DwarfDebug::AddBlockByrefAddress(DbgVariable *&DV, DIE *Die, // Find the __forwarding field and the variable field in the __Block_byref // struct. - + DIArray Fields = blockStruct.getTypeArray(); DIDescriptor varField = DIDescriptor(); DIDescriptor forwardingField = DIDescriptor(); @@ -683,19 +683,19 @@ void DwarfDebug::AddBlockByrefAddress(DbgVariable *&DV, DIE *Die, else if (fieldName == varName) varField = Element; } - + assert (!varField.isNull() && "Can't find byref variable in Block struct"); - assert (!forwardingField.isNull() + assert (!forwardingField.isNull() && "Can't find forwarding field in Block struct"); // Get the offsets for the forwarding field and the variable field. - unsigned int forwardingFieldOffset = + unsigned int forwardingFieldOffset = DIDerivedType(forwardingField.getNode()).getOffsetInBits() >> 3; - unsigned int varFieldOffset = + unsigned int varFieldOffset = DIDerivedType(varField.getNode()).getOffsetInBits() >> 3; - // Decode the original location, and use that as the start of the + // Decode the original location, and use that as the start of the // byref variable's location. unsigned Reg = RI->getDwarfRegNum(Location.getReg(), false); @@ -1393,13 +1393,13 @@ void DwarfDebug::ConstructDefaultDbgScope(MachineFunction *MF) { StringMap<DIE*>::iterator GI = Globals.find(MF->getFunction()->getName()); if (GI != Globals.end()) { DIE *SPDie = GI->second; - + // Add the function bounds. AddLabel(SPDie, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, DWLabel("func_begin", SubprogramCount)); AddLabel(SPDie, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr, DWLabel("func_end", SubprogramCount)); - + MachineLocation Location(RI->getFrameRegister(*MF)); AddAddress(SPDie, dwarf::DW_AT_frame_base, Location); } @@ -1487,7 +1487,7 @@ void DwarfDebug::ConstructCompileUnit(MDNode *N) { void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) { DIGlobalVariable DI_GV(N); - + // If debug information is malformed then ignore it. if (DI_GV.Verify() == false) return; @@ -1582,7 +1582,7 @@ void DwarfDebug::BeginModule(Module *M, MachineModuleInfo *mmi) { DebugTimer->stopTimer(); return; } - + // Create DIEs for each of the externally visible global variables. for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(), E = DbgFinder.global_variable_end(); I != E; ++I) @@ -1904,7 +1904,7 @@ void DwarfDebug::RecordVariable(MDNode *N, unsigned FrameIndex) { Scope = I->second; } } - if (!InlinedVar) + if (!InlinedVar) Scope = getOrCreateScope(Context); } @@ -2109,7 +2109,7 @@ void DwarfDebug::EmitInitial() { didInitial = true; const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); - + // Dwarf sections base addresses. if (MAI->doesDwarfRequireFrameSection()) { Asm->OutStreamer.SwitchSection(TLOF.getDwarfFrameSection()); @@ -2669,7 +2669,7 @@ void DwarfDebug::EmitDebugRanges() { /// EmitDebugMacInfo - Emit visible names into a debug macinfo section. /// void DwarfDebug::EmitDebugMacInfo() { - if (const MCSection *LineInfo = + if (const MCSection *LineInfo = Asm->getObjFileLowering().getDwarfMacroInfoSection()) { // Start the dwarf macinfo section. Asm->OutStreamer.SwitchSection(LineInfo); |