diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-18 23:34:26 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-18 23:34:26 +0000 |
commit | f6fc855a00b57786a7a9132095165575a5e45312 (patch) | |
tree | 8b9da0476de4b0d35aa6509ec99d8396d78143a7 /lib | |
parent | 90420105964371571ccacdf47771c6ca05db2e67 (diff) | |
download | external_llvm-f6fc855a00b57786a7a9132095165575a5e45312.tar.gz external_llvm-f6fc855a00b57786a7a9132095165575a5e45312.tar.bz2 external_llvm-f6fc855a00b57786a7a9132095165575a5e45312.zip |
revert r158660, since Chris has some issues with this patch (namely using code to reprent information only used by the compiler)
Original commit msg:
add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers.
This metadata can be attached to any instruction returning a pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 5 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 33 |
2 files changed, 0 insertions, 38 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index a140543a51..f07f0b3939 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -53,11 +53,6 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { unsigned RangeID = getMDKindID("range"); assert(RangeID == MD_range && "range kind id drifted"); (void)RangeID; - - // Create the 'alloc' metadata kind. - unsigned AllocID = getMDKindID("alloc"); - assert(AllocID == MD_alloc && "alloc kind id drifted"); - (void)AllocID; } LLVMContext::~LLVMContext() { delete pImpl; } diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 2ca4854d9a..477b81dc67 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1672,39 +1672,6 @@ void Verifier::visitInstruction(Instruction &I) { } } - if (MDNode *MD = I.getMetadata(LLVMContext::MD_alloc)) { - Assert1(I.getType()->isPointerTy(), "alloc requires a pointer result", &I); - Assert1(MD->getNumOperands() >= 1, "alloc takes at least one operand", &I); - Function *SizeFn = dyn_cast<Function>(MD->getOperand(0)); - Function *OffsetFn = MD->getNumOperands() >= 2 ? - dyn_cast_or_null<Function>(MD->getOperand(1)) : 0; - Assert1(SizeFn, "first parameter of alloc must be a function", &I); - Assert1(MD->getNumOperands() == 1 || !MD->getOperand(1) || OffsetFn, - "second parameter of alloc must be either a function or null", &I); - Assert1(SizeFn->onlyReadsMemory(), - "size function must be readonly/readnone", &I); - Assert1(!OffsetFn || OffsetFn->onlyReadsMemory(), - "offset function must be readonly/readnone", &I); - Assert1(SizeFn->getReturnType()->isIntegerTy(), - "size function must return an integer", &I); - Assert1(!OffsetFn || OffsetFn->getReturnType()->isIntegerTy(), - "offset function must return an integer", &I); - - FunctionType *SizeFnTy = SizeFn->getFunctionType(); - FunctionType *OffsetFnTy = OffsetFn ? OffsetFn->getFunctionType() : 0; - Assert1(SizeFnTy->getNumParams() == MD->getNumOperands()-2, - "size function number of parameters mismatch", &I); - Assert1(!OffsetFnTy || OffsetFnTy->getNumParams() == MD->getNumOperands()-2, - "offset function number of parameters mismatch", &I); - for (unsigned i = 0, e = SizeFnTy->getNumParams(); i != e; ++i) { - Assert1(SizeFnTy->getParamType(i) == MD->getOperand(i+2)->getType(), - "size function parameter type mismatch", &I); - if (OffsetFnTy) - Assert1(OffsetFnTy->getParamType(i) == MD->getOperand(i+2)->getType(), - "offset function parameter type mismatch", &I); - } - } - MDNode *MD = I.getMetadata(LLVMContext::MD_range); Assert1(!MD || isa<LoadInst>(I), "Ranges are only for loads!", &I); |