Make it illegal to call getDependency* on non-memory instructions
[oota-llvm.git] / include / llvm / Analysis / DebugInfo.h
index 21bbaba07c3d8962533f308061cdc8150beb1e5c..1ee4f5ba44871695193c21d077b5f5e9cfd791bc 100644 (file)
@@ -24,6 +24,7 @@ namespace llvm {
   class Function;
   class GlobalVariable;
   class Module;
+  class Type;
   class Value;
   
   class DIDescriptor {
@@ -71,9 +72,6 @@ namespace llvm {
     bool isNull() const { return GV == 0; }
 
     GlobalVariable *getGV() const { return GV; }
-    
-    /// getCastToEmpty - Return this descriptor as a Constant* with type '{}*'.
-    Constant *getCastToEmpty() const;
   };
   
   /// DIAnchor - A wrapper for various anchor descriptors.
@@ -191,7 +189,7 @@ namespace llvm {
   /// DIGlobal - This is a common class for global variables and subprograms.
   class DIGlobal : public DIDescriptor {
   protected:
-    explicit DIGlobal(GlobalVariable *GV = 0, unsigned RequiredTag)
+    explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag)
       : DIDescriptor(GV, RequiredTag) {}
   public:
     
@@ -259,6 +257,7 @@ namespace llvm {
     Module &M;
     // Cached values for uniquing and faster lookups.
     DIAnchor CompileUnitAnchor, SubProgramAnchor, GlobalVariableAnchor;
+    const Type *EmptyStructPtr; // "{}*".
     Function *StopPointFn;   // llvm.dbg.stoppoint
     Function *FuncStartFn;   // llvm.dbg.func.start
     Function *RegionStartFn; // llvm.dbg.region.start
@@ -270,9 +269,7 @@ namespace llvm {
     DIFactory(const DIFactory &);     // DO NOT IMPLEMENT
     void operator=(const DIFactory&); // DO NOT IMPLEMENT
   public:
-    explicit DIFactory(Module &m) : M(m) {
-      StopPointFn = FuncStartFn = RegionStartFn = RegionEndFn = DeclareFn = 0;
-    }
+    explicit DIFactory(Module &m);
     
     /// GetOrCreateCompileUnitAnchor - Return the anchor for compile units,
     /// creating a new one if there isn't already one in the module.
@@ -386,6 +383,9 @@ namespace llvm {
     Constant *GetTagConstant(unsigned TAG);
     Constant *GetStringConstant(const std::string &String);
     DIAnchor GetOrCreateAnchor(unsigned TAG, const char *Name);
+    
+    /// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'.
+    Constant *getCastToEmpty(DIDescriptor D);
   };