[Modules] Move ValueHandle into the IR library where Value itself lives.
[oota-llvm.git] / lib / IR / LLVMContextImpl.h
index d56616676c9ff41d2542381d4a78e32d6036c33c..7a3cdb9e9d3544b3453a396318747a4e6ddb02a3 100644 (file)
@@ -30,7 +30,7 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/ValueHandle.h"
+#include "llvm/IR/ValueHandle.h"
 #include <vector>
 
 namespace llvm {
@@ -41,7 +41,7 @@ class LLVMContext;
 class Type;
 class Value;
 
-struct LLVM_LIBRARY_VISIBILITY DenseMapAPIntKeyInfo {
+struct DenseMapAPIntKeyInfo {
   struct KeyTy {
     APInt val;
     Type* type;
@@ -66,7 +66,7 @@ struct LLVM_LIBRARY_VISIBILITY DenseMapAPIntKeyInfo {
   }
 };
 
-struct LLVM_LIBRARY_VISIBILITY DenseMapAPFloatKeyInfo {
+struct DenseMapAPFloatKeyInfo {
   struct KeyTy {
     APFloat val;
     KeyTy(const APFloat& V) : val(V){}
@@ -94,7 +94,7 @@ struct LLVM_LIBRARY_VISIBILITY DenseMapAPFloatKeyInfo {
   }
 };
 
-struct LLVM_LIBRARY_VISIBILITY AnonStructTypeKeyInfo {
+struct AnonStructTypeKeyInfo {
   struct KeyTy {
     ArrayRef<Type*> ETypes;
     bool isPacked;
@@ -138,7 +138,7 @@ struct LLVM_LIBRARY_VISIBILITY AnonStructTypeKeyInfo {
   }
 };
 
-struct LLVM_LIBRARY_VISIBILITY FunctionTypeKeyInfo {
+struct FunctionTypeKeyInfo {
   struct KeyTy {
     const Type *ReturnType;
     ArrayRef<Type*> Params;
@@ -209,7 +209,7 @@ template<> struct FoldingSetTrait<MDNode> : DefaultFoldingSetTrait<MDNode> {
 
 /// DebugRecVH - This is a CallbackVH used to keep the Scope -> index maps
 /// up to date as MDNodes mutate.  This class is implemented in DebugLoc.cpp.
-class LLVM_LIBRARY_VISIBILITY DebugRecVH : public CallbackVH {
+class DebugRecVH : public CallbackVH {
   /// Ctx - This is the LLVM Context being referenced.
   LLVMContextImpl *Ctx;
   
@@ -230,7 +230,7 @@ public:
   virtual void allUsesReplacedWith(Value *VNew);
 };
   
-class LLVM_LIBRARY_VISIBILITY LLVMContextImpl {
+class LLVMContextImpl {
 public:
   /// OwnedModules - The set of modules instantiated in this context, and which
   /// will be automatically deleted if this context is deleted.
@@ -238,9 +238,12 @@ public:
   
   LLVMContext::InlineAsmDiagHandlerTy InlineAsmDiagHandler;
   void *InlineAsmDiagContext;
-  
-  typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*, 
-                         DenseMapAPIntKeyInfo> IntMapTy;
+
+  LLVMContext::DiagnosticHandlerTy DiagnosticHandler;
+  void *DiagnosticContext;
+
+  typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt *,
+                   DenseMapAPIntKeyInfo> IntMapTy;
   IntMapTy IntConstants;
   
   typedef DenseMap<DenseMapAPFloatKeyInfo::KeyTy, ConstantFP*, 
@@ -278,8 +281,8 @@ public:
   
   StringMap<ConstantDataSequential*> CDSConstants;
 
-  
-  DenseMap<std::pair<Function*, BasicBlock*> , BlockAddress*> BlockAddresses;
+  DenseMap<std::pair<const Function *, const BasicBlock *>, BlockAddress *>
+    BlockAddresses;
   ConstantUniqueMap<ExprMapKeyType, const ExprMapKeyType&, Type, ConstantExpr>
     ExprConstants;
 
@@ -349,12 +352,22 @@ public:
   /// for an index.  The ValueHandle ensures that ScopeINlinedAtIdx stays up
   /// to date.
   std::vector<std::pair<DebugRecVH, DebugRecVH> > ScopeInlinedAtRecords;
-  
+
+  /// DiscriminatorTable - This table maps file:line locations to an
+  /// integer representing the next DWARF path discriminator to assign to
+  /// instructions in different blocks at the same location.
+  DenseMap<std::pair<const char *, unsigned>, unsigned> DiscriminatorTable;
+
   /// IntrinsicIDCache - Cache of intrinsic name (string) to numeric ID mappings
   /// requested in this context
   typedef DenseMap<const Function*, unsigned> IntrinsicIDCacheTy;
   IntrinsicIDCacheTy IntrinsicIDCache;
 
+  /// \brief Mapping from a function to its prefix data, which is stored as the
+  /// operand of an unparented ReturnInst so that the prefix data has a Use.
+  typedef DenseMap<const Function *, ReturnInst *> PrefixDataMapTy;
+  PrefixDataMapTy PrefixDataMap;
+
   int getOrAddScopeRecordIdxEntry(MDNode *N, int ExistingIdx);
   int getOrAddScopeInlinedAtIdxEntry(MDNode *Scope, MDNode *IA,int ExistingIdx);