diff options
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index fe2253d..0abd5f7 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -72,6 +72,7 @@ #include "llvm/IR/Comdat.h" #include "llvm/IR/Constant.h" #include "llvm/IR/ConstantRange.h" +#include "llvm/IR/ConstantRangeList.h" #include "llvm/IR/Constants.h" #include "llvm/IR/ConvergenceVerifier.h" #include "llvm/IR/DataLayout.h" @@ -2059,6 +2060,14 @@ void Verifier::verifyParameterAttrs(AttributeSet Attrs, Type *Ty, } } + if (Attrs.hasAttribute(Attribute::Initializes)) { + auto Inits = Attrs.getAttribute(Attribute::Initializes).getInitializes(); + Check(!Inits.empty(), "Attribute 'initializes' does not support empty list", + V); + Check(ConstantRangeList::isOrderedRanges(Inits), + "Attribute 'initializes' does not support unordered ranges", V); + } + if (Attrs.hasAttribute(Attribute::NoFPClass)) { uint64_t Val = Attrs.getAttribute(Attribute::NoFPClass).getValueAsInt(); Check(Val != 0, "Attribute 'nofpclass' must have at least one test bit set", |