diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 6452608af6b..55d3122bbd8 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -1370,7 +1370,7 @@ AttrBuilder &AttrBuilder::addRawValue(uint64_t Val) { //===----------------------------------------------------------------------===// /// \brief Which attributes cannot be applied to a type. -AttributeSet AttributeFuncs::typeIncompatible(Type *Ty, uint64_t Index) { +AttrBuilder AttributeFuncs::typeIncompatible(const Type *Ty) { AttrBuilder Incompatible; if (!Ty->isIntegerTy()) @@ -1392,5 +1392,5 @@ AttributeSet AttributeFuncs::typeIncompatible(Type *Ty, uint64_t Index) { .addAttribute(Attribute::StructRet) .addAttribute(Attribute::InAlloca); - return AttributeSet::get(Ty->getContext(), Index, Incompatible); + return Incompatible; } diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 16f343aee56..1a30d5b5448 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1350,9 +1350,10 @@ void Verifier::VerifyParameterAttrs(AttributeSet Attrs, unsigned Idx, Type *Ty, V); Assert(!AttrBuilder(Attrs, Idx) - .hasAttributes(AttributeFuncs::typeIncompatible(Ty, Idx), Idx), + .overlaps(AttributeFuncs::typeIncompatible(Ty)), "Wrong types for attribute: " + - AttributeFuncs::typeIncompatible(Ty, Idx).getAsString(Idx), + AttributeSet::get(*Context, Idx, + AttributeFuncs::typeIncompatible(Ty)).getAsString(Idx), V); if (PointerType *PTy = dyn_cast<PointerType>(Ty)) { |