[llvm-commits] [llvm] r92261 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp

Chris Lattner sabre at nondot.org
Tue Dec 29 01:15:46 PST 2009


Author: lattner
Date: Tue Dec 29 03:15:46 2009
New Revision: 92261

URL: http://llvm.org/viewvc/llvm-project?rev=92261&view=rev
Log:
one pass of cleanup over DebugInfo.h.  Much more is still needed.

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h
    llvm/trunk/lib/Analysis/DebugInfo.cpp

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

==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Dec 29 03:15:46 2009
@@ -17,14 +17,10 @@
 #ifndef LLVM_ANALYSIS_DEBUGINFO_H
 #define LLVM_ANALYSIS_DEBUGINFO_H
 
-#include "llvm/Metadata.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/Metadata.h"  // FIXME: Should not need this.
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/ValueHandle.h"
+#include "llvm/Support/Dwarf.h"  // FIXME: Should not need this.
 
 namespace llvm {
   class BasicBlock;
@@ -42,13 +38,13 @@
   class DebugLoc;
   struct DebugLocTracker;
   class Instruction;
-  class LLVMContext;
 
-  /// DIDescriptor - A thin wraper around MDNode to access encoded debug info. This should not
-  /// be stored in a container, because underly MDNode may change in certain situations.
+  /// DIDescriptor - A thin wraper around MDNode to access encoded debug info.
+  /// This should not be stored in a container, because underly MDNode may
+  /// change in certain situations.
   class DIDescriptor {
   protected:
-    MDNode  *DbgNode;
+    MDNode *DbgNode;
 
     /// DIDescriptor constructor.  If the specified node is non-null, check
     /// to make sure that the tag in the descriptor matches 'RequiredTag'.  If
@@ -86,7 +82,7 @@
     }
 
     /// ValidDebugInfo - Return true if N represents valid debug info value.
-    static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel);
+    static bool ValidDebugInfo(MDNode *N, unsigned OptLevel);
 
     /// dump - print descriptor.
     void dump() const;
@@ -483,7 +479,7 @@
     StringRef getName() const      { return getStringField(2);           }
     StringRef getDirectory() const { return getContext().getDirectory(); }
     StringRef getFilename() const  { return getContext().getFilename();  }
-    DICompileUnit getCompileUnit() const { return getFieldAs<DICompileUnit>(3); }
+    DICompileUnit getCompileUnit() const { return getFieldAs<DICompileUnit>(3);}
     unsigned getLineNumber() const { return getUnsignedField(4);         }
   };
 
@@ -688,34 +684,29 @@
   /// Find the debug info descriptor corresponding to this global variable.
   Value *findDbgGlobalDeclare(GlobalVariable *V);
 
-bool getLocationInfo(const Value *V, std::string &DisplayName,
-                     std::string &Type, unsigned &LineNo, std::string &File,
-                     std::string &Dir);
+  bool getLocationInfo(const Value *V, std::string &DisplayName,
+                       std::string &Type, unsigned &LineNo, std::string &File,
+                       std::string &Dir);
 
   /// isValidDebugInfoIntrinsic - Return true if SPI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI,
-                                 CodeGenOpt::Level OptLev);
+  bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI, unsigned OptLev);
 
   /// isValidDebugInfoIntrinsic - Return true if FSI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI,
-                                 CodeGenOpt::Level OptLev);
+  bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI, unsigned OptLev);
 
   /// isValidDebugInfoIntrinsic - Return true if RSI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI,
-                                 CodeGenOpt::Level OptLev);
+  bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI, unsigned OptLev);
 
   /// isValidDebugInfoIntrinsic - Return true if REI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI,
-                                 CodeGenOpt::Level OptLev);
+  bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI, unsigned OptLev);
 
   /// isValidDebugInfoIntrinsic - Return true if DI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI,
-                                 CodeGenOpt::Level OptLev);
+  bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI, unsigned OptLev);
 
   /// ExtractDebugLocation - Extract debug location information
   /// from llvm.dbg.stoppoint intrinsic.

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

==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Dec 29 03:15:46 2009
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/DebugInfo.h"
+#include "llvm/Target/TargetMachine.h"  // FIXME: LAYERING VIOLATION!
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Intrinsics.h"
@@ -34,7 +35,7 @@
 
 /// ValidDebugInfo - Return true if V represents valid debug info value.
 /// FIXME : Add DIDescriptor.isValid()
-bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel) {
+bool DIDescriptor::ValidDebugInfo(MDNode *N, unsigned OptLevel) {
   if (!N)
     return false;
 
@@ -1353,7 +1354,7 @@
 
 bool getLocationInfo(const Value *V, std::string &DisplayName,
                      std::string &Type, unsigned &LineNo, std::string &File,
-                       std::string &Dir) {
+                     std::string &Dir) {
     DICompileUnit Unit;
     DIType TypeD;
 
@@ -1395,37 +1396,32 @@
 
   /// isValidDebugInfoIntrinsic - Return true if SPI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI,
-                                 CodeGenOpt::Level OptLev) {
+  bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI, unsigned OptLev) {
     return DIDescriptor::ValidDebugInfo(SPI.getContext(), OptLev);
   }
 
   /// isValidDebugInfoIntrinsic - Return true if FSI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI,
-                                 CodeGenOpt::Level OptLev) {
+  bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI, unsigned OptLev) {
     return DIDescriptor::ValidDebugInfo(FSI.getSubprogram(), OptLev);
   }
 
   /// isValidDebugInfoIntrinsic - Return true if RSI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI,
-                                 CodeGenOpt::Level OptLev) {
+  bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI, unsigned OptLev) {
     return DIDescriptor::ValidDebugInfo(RSI.getContext(), OptLev);
   }
 
   /// isValidDebugInfoIntrinsic - Return true if REI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI,
-                                 CodeGenOpt::Level OptLev) {
+  bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI, unsigned OptLev) {
     return DIDescriptor::ValidDebugInfo(REI.getContext(), OptLev);
   }
 
 
   /// isValidDebugInfoIntrinsic - Return true if DI is a valid debug
   /// info intrinsic.
-  bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI,
-                                 CodeGenOpt::Level OptLev) {
+  bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI, unsigned OptLev) {
     return DIDescriptor::ValidDebugInfo(DI.getVariable(), OptLev);
   }
 





More information about the llvm-commits mailing list