X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FLLVMContextImpl.cpp;h=48df5ba62f049f6b8d21aea42e9d33fb20bba8e5;hb=83fc12aeed03b6423fdf973ad4ae351202fe0982;hp=dc367fee88423a72abc99628b5049363a757f5dc;hpb=2dacece9e2c9db49f31a1e1432604f0411018290;p=oota-llvm.git diff --git a/lib/IR/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp index dc367fee884..48df5ba62f0 100644 --- a/lib/IR/LLVMContextImpl.cpp +++ b/lib/IR/LLVMContextImpl.cpp @@ -21,6 +21,7 @@ using namespace llvm; LLVMContextImpl::LLVMContextImpl(LLVMContext &C) : TheTrueVal(nullptr), TheFalseVal(nullptr), + TheNoneToken(nullptr), VoidTy(C, Type::VoidTyID), LabelTy(C, Type::LabelTyID), HalfTy(C, Type::HalfTyID), @@ -219,6 +220,23 @@ unsigned MDNodeOpsKey::calculateHash(ArrayRef Ops) { return hash_combine_range(Ops.begin(), Ops.end()); } +StringMapEntry *LLVMContextImpl::getOrInsertBundleTag(StringRef Tag) { + uint32_t NewIdx = BundleTagCache.size(); + return &*(BundleTagCache.insert(std::make_pair(Tag, NewIdx)).first); +} + +void LLVMContextImpl::getOperandBundleTags(SmallVectorImpl &Tags) const { + Tags.resize(BundleTagCache.size()); + for (const auto &T : BundleTagCache) + Tags[T.second] = T.first(); +} + +uint32_t LLVMContextImpl::getOperandBundleTagID(StringRef Tag) const { + auto I = BundleTagCache.find(Tag); + assert(I != BundleTagCache.end() && "Unknown tag!"); + return I->second; +} + // ConstantsContext anchors void UnaryConstantExpr::anchor() { }