diff options
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/NaCl/ReplacePtrsWithInts.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/NaCl/StripAttributes.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp b/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp index cee574296f..0a00fe4361 100644 --- a/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp +++ b/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp @@ -309,6 +309,9 @@ static AttributeSet RemovePointerAttrs(LLVMContext &Context, AttrBuilder AB; for (AttributeSet::iterator Attr = Attrs.begin(Slot), E = Attrs.end(Slot); Attr != E; ++Attr) { + if (!Attr->isEnumAttribute()) { + continue; + } switch (Attr->getKindAsEnum()) { // ByVal and StructRet should already have been removed by the // ExpandByVal pass. diff --git a/lib/Transforms/NaCl/StripAttributes.cpp b/lib/Transforms/NaCl/StripAttributes.cpp index fb3a080e84..184e06aba1 100644 --- a/lib/Transforms/NaCl/StripAttributes.cpp +++ b/lib/Transforms/NaCl/StripAttributes.cpp @@ -61,6 +61,9 @@ static void CheckAttributes(AttributeSet Attrs) { for (unsigned Slot = 0; Slot < Attrs.getNumSlots(); ++Slot) { for (AttributeSet::iterator Attr = Attrs.begin(Slot), E = Attrs.end(Slot); Attr != E; ++Attr) { + if (!Attr->isEnumAttribute()) { + continue; + } switch (Attr->getKindAsEnum()) { // The following attributes can affect calling conventions. // Rather than complaining, we just strip these out. |