diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-07-18 09:38:12 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-07-18 09:38:12 -0700 |
commit | a481fd78c6e3226e1de78c25e63265a9ebab8b22 (patch) | |
tree | d7c4b5aa340e386a02d04155aeee743ebc826dbf | |
parent | 0592f0ef8bbc825243cb1860b09468a7605f8716 (diff) |
Adding checks for isEnumAttribute because getKindAsEnum now asserts
-rw-r--r-- | lib/Transforms/NaCl/ExpandByVal.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/NaCl/ExpandByVal.cpp b/lib/Transforms/NaCl/ExpandByVal.cpp index 7227f3e501..0220cafb88 100644 --- a/lib/Transforms/NaCl/ExpandByVal.cpp +++ b/lib/Transforms/NaCl/ExpandByVal.cpp @@ -78,6 +78,7 @@ AttributeSet RemoveAttrs(LLVMContext &Context, AttributeSet Attrs) { for (AttributeSet::iterator Attr = Attrs.begin(Slot), E = Attrs.end(Slot); Attr != E; ++Attr) { if (!Attr->isAlignAttribute() && + Attr->isEnumAttribute() && Attr->getKindAsEnum() != Attribute::ByVal && Attr->getKindAsEnum() != Attribute::StructRet) { AB.addAttribute(*Attr); @@ -87,7 +88,8 @@ AttributeSet RemoveAttrs(LLVMContext &Context, AttributeSet Attrs) { // example, a global variable address can be passed as a // StructRet argument, although Clang does not do so and Clang // explicitly adds NoAlias to StructRet arguments. - if (Attr->getKindAsEnum() == Attribute::ByVal) { + if (Attr->isEnumAttribute() && + Attr->getKindAsEnum() == Attribute::ByVal) { AB.addAttribute(Attribute::get(Context, Attribute::NoAlias)); } } |