X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FLLVMContext.cpp;h=af998c861357121ee5732cdcc3395dd714bda180;hb=868145efb053c3f9294676cf4f36d6220e500269;hp=803d24bcb76d464f188495f17215149b6fea1de9;hpb=9224227bc2310ddda5e4bf7bc8aebde48fae7f4d;p=oota-llvm.git diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp index 803d24bcb76..af998c86135 100644 --- a/lib/IR/LLVMContext.cpp +++ b/lib/IR/LLVMContext.cpp @@ -110,6 +110,28 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { assert(MakeImplicitID == MD_make_implicit && "make.implicit kind id drifted"); (void)MakeImplicitID; + + // Create the 'unpredictable' metadata kind. + unsigned UnpredictableID = getMDKindID("unpredictable"); + assert(UnpredictableID == MD_unpredictable && + "unpredictable kind id drifted"); + (void)UnpredictableID; + + // Create the 'invariant.group' metadata kind. + unsigned InvariantGroupId = getMDKindID("invariant.group"); + assert(InvariantGroupId == MD_invariant_group && + "invariant.group kind id drifted"); + (void)InvariantGroupId; + + // Create the 'align' metadata kind. + unsigned AlignID = getMDKindID("align"); + assert(AlignID == MD_align && "align kind id drifted"); + (void)AlignID; + + auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt"); + assert(DeoptEntry->second == LLVMContext::OB_deopt && + "deopt operand bundle id drifted!"); + (void)DeoptEntry; } LLVMContext::~LLVMContext() { delete pImpl; } @@ -261,7 +283,7 @@ unsigned LLVMContext::getMDKindID(StringRef Name) const { .first->second; } -/// getHandlerNames - Populate client supplied smallvector using custome +/// getHandlerNames - Populate client-supplied smallvector using custom /// metadata name and ID. void LLVMContext::getMDKindNames(SmallVectorImpl &Names) const { Names.resize(pImpl->CustomMDKindNames.size()); @@ -269,3 +291,11 @@ void LLVMContext::getMDKindNames(SmallVectorImpl &Names) const { E = pImpl->CustomMDKindNames.end(); I != E; ++I) Names[I->second] = I->first(); } + +void LLVMContext::getOperandBundleTags(SmallVectorImpl &Tags) const { + pImpl->getOperandBundleTags(Tags); +} + +uint32_t LLVMContext::getOperandBundleTagID(StringRef Tag) const { + return pImpl->getOperandBundleTagID(Tag); +}