diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-07-02 03:28:10 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-07-02 03:28:10 +0000 |
commit | effd02c91d12c386880f53c8c55f631cb5bb8841 (patch) | |
tree | a12d040c48d4e67e29e10ebfec74e0cfb8f35b97 /llvm/lib | |
parent | b0b4513ea2c1081f489c6a29f614aa511909ba43 (diff) | |
download | bcm5719-llvm-effd02c91d12c386880f53c8c55f631cb5bb8841.tar.gz bcm5719-llvm-effd02c91d12c386880f53c8c55f631cb5bb8841.zip |
IRVerifier: Correctly check attribute types
Add missing parenthesis such that all and not only the very first attribute
is checked.
Testing this piece of code is not possible with an LLVM-IR test file, as the
LLVM-IR parser has a similar check such that the wrong IR does not even arrive
at the verifier.
llvm-svn: 185408
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 7123eaf18a0..8b4c1655d8d 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -695,10 +695,11 @@ void Verifier::VerifyAttributeTypes(AttributeSet Attrs, unsigned Idx, I->getKindAsEnum() == Attribute::Builtin || I->getKindAsEnum() == Attribute::NoBuiltin || I->getKindAsEnum() == Attribute::Cold) { - if (!isFunction) + if (!isFunction) { CheckFailed("Attribute '" + I->getAsString() + "' only applies to functions!", V); return; + } } else if (isFunction) { CheckFailed("Attribute '" + I->getAsString() + "' does not apply to functions!", V); |