[llvm-commits] [llvm] r82332 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Support/ValueHandle.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Daniel Dunbar daniel at zuster.org
Sat Sep 19 13:40:06 PDT 2009


Author: ddunbar
Date: Sat Sep 19 15:40:05 2009
New Revision: 82332

URL: http://llvm.org/viewvc/llvm-project?rev=82332&view=rev
Log:
Strip trailing whitespace.

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h
    llvm/trunk/include/llvm/Support/ValueHandle.h
    llvm/trunk/lib/Analysis/DebugInfo.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=82332&r1=82331&r2=82332&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Sat Sep 19 15:40:05 2009
@@ -44,7 +44,7 @@
   class LLVMContext;
 
   class DIDescriptor {
-  protected:    
+  protected:
     MDNode *DbgNode;
 
     /// DIDescriptor constructor.  If the specified node is non-null, check
@@ -112,7 +112,7 @@
   /// DIArray - This descriptor holds an array of descriptors.
   class DIArray : public DIDescriptor {
   public:
-    explicit DIArray(MDNode *N = 0) 
+    explicit DIArray(MDNode *N = 0)
       : DIDescriptor(N) {}
 
     unsigned getNumElements() const;
@@ -158,14 +158,14 @@
     const std::string &getProducer(std::string &F) const {
       return getStringField(5, F);
     }
-    
+
     /// isMain - Each input file is encoded as a separate compile unit in LLVM
     /// debugging information output. However, many target specific tool chains
-    /// prefer to encode only one compile unit in an object file. In this 
+    /// prefer to encode only one compile unit in an object file. In this
     /// situation, the LLVM code generator will include  debugging information
-    /// entities in the compile unit that is marked as main compile unit. The 
+    /// entities in the compile unit that is marked as main compile unit. The
     /// code generator accepts maximum one main compile unit per module. If a
-    /// module does not contain any main compile unit then the code generator 
+    /// module does not contain any main compile unit then the code generator
     /// will emit multiple compile units in the output object file.
 
     bool isMain() const                { return getUnsignedField(6); }
@@ -210,7 +210,7 @@
     };
 
   protected:
-    DIType(MDNode *N, unsigned Tag) 
+    DIType(MDNode *N, unsigned Tag)
       : DIDescriptor(N, Tag) {}
     // This ctor is used when the Tag has already been validated by a derived
     // ctor.
@@ -238,17 +238,17 @@
     uint64_t getOffsetInBits() const    { return getUInt64Field(7); }
     unsigned getFlags() const           { return getUnsignedField(8); }
     bool isPrivate() const {
-      return (getFlags() & FlagPrivate) != 0; 
+      return (getFlags() & FlagPrivate) != 0;
     }
     bool isProtected() const {
-      return (getFlags() & FlagProtected) != 0; 
+      return (getFlags() & FlagProtected) != 0;
     }
     bool isForwardDecl() const {
-      return (getFlags() & FlagFwdDecl) != 0; 
+      return (getFlags() & FlagFwdDecl) != 0;
     }
     // isAppleBlock - Return true if this is the Apple Blocks extension.
     bool isAppleBlockExtension() const {
-      return (getFlags() & FlagAppleBlock) != 0; 
+      return (getFlags() & FlagAppleBlock) != 0;
     }
     bool isBlockByrefStruct() const {
       return (getFlags() & FlagBlockByrefStruct) != 0;
@@ -448,8 +448,8 @@
 
     /// isBlockByrefVariable - Return true if the variable was declared as
     /// a "__block" variable (Apple Blocks).
-    bool isBlockByrefVariable() const { 
-      return getType().isBlockByrefStruct(); 
+    bool isBlockByrefVariable() const {
+      return getType().isBlockByrefStruct();
     }
 
     /// dump - print variable.
@@ -461,7 +461,7 @@
   public:
     explicit DILexicalBlock(MDNode *N = 0) {
       DbgNode = N;
-      if (DbgNode && !isLexicalBlock()) 
+      if (DbgNode && !isLexicalBlock())
 	DbgNode = 0;
     }
     DIScope getContext() const { return getFieldAs<DIScope>(1); }
@@ -484,11 +484,11 @@
     unsigned getColumnNumber() const   { return getUnsignedField(1); }
     DIScope  getScope() const          { return getFieldAs<DIScope>(3); }
     DILocation getOrigLocation() const { return getFieldAs<DILocation>(4); }
-    std::string getFilename(std::string &F) const  { 
-      return getScope().getFilename(F); 
+    std::string getFilename(std::string &F) const  {
+      return getScope().getFilename(F);
     }
-    std::string getDirectory(std::string &D) const { 
-      return getScope().getDirectory(D); 
+    std::string getDirectory(std::string &D) const {
+      return getScope().getDirectory(D);
     }
   };
 
@@ -497,7 +497,7 @@
   class DIFactory {
     Module &M;
     LLVMContext& VMContext;
-    
+
     // Cached values for uniquing and faster lookups.
     const Type *EmptyStructPtr; // "{}*".
     Function *StopPointFn;   // llvm.dbg.stoppoint
@@ -513,7 +513,7 @@
   public:
     explicit DIFactory(Module &m);
 
-    /// 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 GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys);
 
@@ -577,7 +577,7 @@
     DIGlobalVariable
     CreateGlobalVariable(DIDescriptor Context, const std::string &Name,
                          const std::string &DisplayName,
-                         const std::string &LinkageName, 
+                         const std::string &LinkageName,
                          DICompileUnit CompileUnit,
                          unsigned LineNo, DIType Type, bool isLocalToUnit,
                          bool isDefinition, llvm::GlobalVariable *GV);
@@ -588,12 +588,12 @@
                               DICompileUnit CompileUnit, unsigned LineNo,
                               DIType Type);
 
-    /// CreateLexicalBlock - This creates a descriptor for a lexical block 
+    /// CreateLexicalBlock - This creates a descriptor for a lexical block
     /// with the specified parent context.
     DILexicalBlock CreateLexicalBlock(DIDescriptor Context);
 
     /// CreateLocation - Creates a debug info location.
-    DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo, 
+    DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo,
 			      DIScope S, DILocation OrigLoc);
 
     /// InsertStopPoint - Create a new llvm.dbg.stoppoint intrinsic invocation,
@@ -621,10 +621,10 @@
   };
 
   /// Finds the stoppoint coressponding to this instruction, that is the
-  /// stoppoint that dominates this instruction 
+  /// stoppoint that dominates this instruction
   const DbgStopPointInst *findStopPoint(const Instruction *Inst);
 
-  /// Finds the stoppoint corresponding to first real (non-debug intrinsic) 
+  /// Finds the stoppoint corresponding to first real (non-debug intrinsic)
   /// instruction in this Basic Block, and returns the stoppoint for it.
   const DbgStopPointInst *findBBStopPoint(const BasicBlock *BB);
 
@@ -635,46 +635,46 @@
   /// Find the debug info descriptor corresponding to this global variable.
   Value *findDbgGlobalDeclare(GlobalVariable *V);
 
-  bool getLocationInfo(const Value *V, std::string &DisplayName, 
+  bool getLocationInfo(const Value *V, std::string &DisplayName,
                        std::string &Type, unsigned &LineNo, std::string &File,
-                       std::string &Dir); 
+                       std::string &Dir);
 
-  /// 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);
 
-  /// 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);
 
-  /// 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);
 
-  /// 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);
 
-  /// 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);
 
-  /// ExtractDebugLocation - Extract debug location information 
+  /// ExtractDebugLocation - Extract debug location information
   /// from llvm.dbg.stoppoint intrinsic.
   DebugLoc ExtractDebugLocation(DbgStopPointInst &SPI,
                                 DebugLocTracker &DebugLocInfo);
 
-  /// ExtractDebugLocation - Extract debug location information 
+  /// ExtractDebugLocation - Extract debug location information
   /// from DILocation.
   DebugLoc ExtractDebugLocation(DILocation &Loc,
                                 DebugLocTracker &DebugLocInfo);
 
-  /// ExtractDebugLocation - Extract debug location information 
+  /// ExtractDebugLocation - Extract debug location information
   /// from llvm.dbg.func_start intrinsic.
   DebugLoc ExtractDebugLocation(DbgFuncStartInst &FSI,
                                 DebugLocTracker &DebugLocInfo);
@@ -691,7 +691,7 @@
     /// processModule - Process entire module and collect debug info
     /// anchors.
     void processModule(Module &M);
-    
+
   private:
     /// processType - Process DIType.
     void processType(DIType DT);
@@ -716,7 +716,7 @@
 
     /// addCompileUnit - Add compile unit into CUs.
     bool addCompileUnit(DICompileUnit CU);
-    
+
     /// addGlobalVariable - Add global variable into GVs.
     bool addGlobalVariable(DIGlobalVariable DIG);
 

Modified: llvm/trunk/include/llvm/Support/ValueHandle.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ValueHandle.h?rev=82332&r1=82331&r2=82332&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/ValueHandle.h (original)
+++ llvm/trunk/include/llvm/Support/ValueHandle.h Sat Sep 19 15:40:05 2009
@@ -49,7 +49,7 @@
     Callback
   };
 private:
-  
+
   PointerIntPair<ValueHandleBase**, 2, HandleBaseKind> PrevPair;
   ValueHandleBase *Next;
   Value *VP;
@@ -68,9 +68,9 @@
   }
   ~ValueHandleBase() {
     if (isValid(VP))
-      RemoveFromUseList();   
+      RemoveFromUseList();
   }
-  
+
   Value *operator=(Value *RHS) {
     if (VP == RHS) return RHS;
     if (isValid(VP)) RemoveFromUseList();
@@ -86,7 +86,7 @@
     if (isValid(VP)) AddToExistingUseList(RHS.getPrevPtr());
     return VP;
   }
-  
+
   Value *operator->() const { return getValPtr(); }
   Value &operator*() const { return *getValPtr(); }
 
@@ -102,22 +102,22 @@
   // Callbacks made from Value.
   static void ValueIsDeleted(Value *V);
   static void ValueIsRAUWd(Value *Old, Value *New);
-  
+
   // Internal implementation details.
   ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
   HandleBaseKind getKind() const { return PrevPair.getInt(); }
   void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
-  
+
   /// AddToExistingUseList - Add this ValueHandle to the use list for VP,
   /// where List is known to point into the existing use list.
   void AddToExistingUseList(ValueHandleBase **List);
-  
+
   /// AddToUseList - Add this ValueHandle to the use list for VP.
   void AddToUseList();
   /// RemoveFromUseList - Remove this ValueHandle from its current use list.
   void RemoveFromUseList();
 };
-  
+
 /// WeakVH - This is a value handle that tries hard to point to a Value, even
 /// across RAUW operations, but will null itself out if the value is destroyed.
 /// this is useful for advisory sorts of information, but should not be used as
@@ -160,7 +160,7 @@
 /// AssertingVH's as it moves.  This is required because in non-assert mode this
 /// class turns into a trivial wrapper around a pointer.
 template <typename ValueTy>
-class AssertingVH 
+class AssertingVH
 #ifndef NDEBUG
   : public ValueHandleBase
 #endif

Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=82332&r1=82331&r2=82332&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Sat Sep 19 15:40:05 2009
@@ -71,7 +71,7 @@
 
 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 @@
   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 @@
 }
 
 GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const {
-  if (DbgNode == 0) 
+  if (DbgNode == 0)
     return 0;
 
   if (Elt < DbgNode->getNumElements())
@@ -132,7 +132,7 @@
 bool DIDescriptor::isBasicType() const {
   assert (!isNull() && "Invalid descriptor!");
   unsigned Tag = getTag();
-  
+
   return Tag == dwarf::DW_TAG_base_type;
 }
 
@@ -197,7 +197,7 @@
 bool DIDescriptor::isSubprogram() const {
   assert (!isNull() && "Invalid descriptor!");
   unsigned Tag = getTag();
-  
+
   return Tag == dwarf::DW_TAG_subprogram;
 }
 
@@ -210,7 +210,7 @@
   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 @@
 
 /// 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 @@
 
 /// 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 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 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 DIVariable::Verify() const {
   if (isNull())
     return false;
-  
+
   if (getContext().isNull())
     return false;
 
@@ -420,14 +420,14 @@
 
   // 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 @@
 //===----------------------------------------------------------------------===//
 
 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 @@
 // 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 @@
     ConstantInt::get(Type::getInt64Ty(VMContext), Lo),
     ConstantInt::get(Type::getInt64Ty(VMContext), Hi)
   };
-  
+
   return DISubrange(MDNode::get(VMContext, &Elts[0], 3));
 }
 
@@ -705,7 +705,7 @@
 /// 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 @@
                                 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 @@
 }
 
 /// 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 @@
 /// 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 @@
   // 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::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 @@
     }
   }
 }
-    
+
 /// processType - Process DIType.
 void DebugInfoFinder::processType(DIType DT) {
   if (!addType(DT))
@@ -926,12 +926,12 @@
         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 @@
   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::addSubprogram(DISubprogram SP) {
   if (SP.isNull())
     return false;
-  
+
   if (!NodesSeen.insert(SP.getNode()))
     return false;
 
@@ -1083,7 +1083,7 @@
     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 @@
     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 @@
   }
 
 
-  /// 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 @@
     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 @@
     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 @@
     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 @@
     unsigned Id = DebugLocInfo.DebugLocations.size();
     DebugLocInfo.DebugLocations.push_back(Tuple);
     DebugLocInfo.DebugIdMap[Tuple] = Id;
-    
+
     return DebugLoc::get(Id);
   }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=82332&r1=82331&r2=82332&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Sep 19 15:40:05 2009
@@ -150,7 +150,7 @@
   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 @@
 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 @@
    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 @@
 /// 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 @@
 
    // 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 @@
      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 @@
   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::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 @@
       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 @@
         Scope = I->second;
       }
     }
-    if (!InlinedVar) 
+    if (!InlinedVar)
       Scope = getOrCreateScope(Context);
   }
 
@@ -2109,7 +2109,7 @@
   didInitial = true;
 
   const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
-  
+
   // Dwarf sections base addresses.
   if (MAI->doesDwarfRequireFrameSection()) {
     Asm->OutStreamer.SwitchSection(TLOF.getDwarfFrameSection());
@@ -2669,7 +2669,7 @@
 /// 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);





More information about the llvm-commits mailing list