X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FLLVMContextImpl.h;h=1eead4ad41d5b034f21e8c2b36eadbea68da5d78;hb=fd0a8133e56e6c48d04e395290da69c3926a48d1;hp=d56616676c9ff41d2542381d4a78e32d6036c33c;hpb=15f387c93ef8d5c23f110143996c8b9b4a089864;p=oota-llvm.git diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h index d56616676c9..1eead4ad41d 100644 --- a/lib/IR/LLVMContextImpl.h +++ b/lib/IR/LLVMContextImpl.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LLVMCONTEXT_IMPL_H -#define LLVM_LLVMCONTEXT_IMPL_H +#ifndef LLVM_LIB_IR_LLVMCONTEXTIMPL_H +#define LLVM_LIB_IR_LLVMCONTEXTIMPL_H #include "AttributeImpl.h" #include "ConstantsContext.h" @@ -30,18 +30,21 @@ #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 namespace llvm { class ConstantInt; class ConstantFP; +class DiagnosticInfoOptimizationRemark; +class DiagnosticInfoOptimizationRemarkMissed; +class DiagnosticInfoOptimizationRemarkAnalysis; class LLVMContext; class Type; class Value; -struct LLVM_LIBRARY_VISIBILITY DenseMapAPIntKeyInfo { +struct DenseMapAPIntKeyInfo { struct KeyTy { APInt val; Type* type; @@ -56,8 +59,8 @@ struct LLVM_LIBRARY_VISIBILITY DenseMapAPIntKeyInfo { return hash_combine(Key.type, Key.val); } }; - static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), 0); } - static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), 0); } + static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), nullptr); } + static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), nullptr); } static unsigned getHashValue(const KeyTy &Key) { return static_cast(hash_value(Key)); } @@ -66,7 +69,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 +97,7 @@ struct LLVM_LIBRARY_VISIBILITY DenseMapAPFloatKeyInfo { } }; -struct LLVM_LIBRARY_VISIBILITY AnonStructTypeKeyInfo { +struct AnonStructTypeKeyInfo { struct KeyTy { ArrayRef ETypes; bool isPacked; @@ -138,7 +141,7 @@ struct LLVM_LIBRARY_VISIBILITY AnonStructTypeKeyInfo { } }; -struct LLVM_LIBRARY_VISIBILITY FunctionTypeKeyInfo { +struct FunctionTypeKeyInfo { struct KeyTy { const Type *ReturnType; ArrayRef Params; @@ -209,7 +212,7 @@ template<> struct FoldingSetTrait : DefaultFoldingSetTrait { /// 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; @@ -225,12 +228,12 @@ public: MDNode *get() const { return cast_or_null(getValPtr()); } - - virtual void deleted(); - virtual void allUsesReplacedWith(Value *VNew); + + void deleted() override; + void allUsesReplacedWith(Value *VNew) override; }; -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 +241,15 @@ public: LLVMContext::InlineAsmDiagHandlerTy InlineAsmDiagHandler; void *InlineAsmDiagContext; - - typedef DenseMap IntMapTy; + + LLVMContext::DiagnosticHandlerTy DiagnosticHandler; + void *DiagnosticContext; + + LLVMContext::YieldCallbackTy YieldCallback; + void *YieldOpaqueHandle; + + typedef DenseMap IntMapTy; IntMapTy IntConstants; typedef DenseMap CDSConstants; - - DenseMap , BlockAddress*> BlockAddresses; + DenseMap, BlockAddress *> + BlockAddresses; ConstantUniqueMap ExprConstants; @@ -349,12 +358,22 @@ public: /// for an index. The ValueHandle ensures that ScopeINlinedAtIdx stays up /// to date. std::vector > 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, unsigned> DiscriminatorTable; + /// IntrinsicIDCache - Cache of intrinsic name (string) to numeric ID mappings /// requested in this context typedef DenseMap 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 PrefixDataMapTy; + PrefixDataMapTy PrefixDataMap; + int getOrAddScopeRecordIdxEntry(MDNode *N, int ExistingIdx); int getOrAddScopeInlinedAtIdxEntry(MDNode *Scope, MDNode *IA,int ExistingIdx);