mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Attributes noinline alwaysinline are incompatible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ae641f4d1
commit
7c31085b1c
@ -60,10 +60,11 @@ const Attributes ReturnOnly = NoReturn | NoUnwind | ReadNone | ReadOnly;
|
|||||||
const Attributes VarArgsIncompatible = StructRet;
|
const Attributes VarArgsIncompatible = StructRet;
|
||||||
|
|
||||||
/// @brief Attributes that are mutually incompatible.
|
/// @brief Attributes that are mutually incompatible.
|
||||||
const Attributes MutuallyIncompatible[3] = {
|
const Attributes MutuallyIncompatible[4] = {
|
||||||
ByVal | InReg | Nest | StructRet,
|
ByVal | InReg | Nest | StructRet,
|
||||||
ZExt | SExt,
|
ZExt | SExt,
|
||||||
ReadNone | ReadOnly
|
ReadNone | ReadOnly,
|
||||||
|
NoInline | AlwaysInline
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @brief Which attributes cannot be applied to a type.
|
/// @brief Which attributes cannot be applied to a type.
|
||||||
|
@ -475,6 +475,23 @@ void Verifier::VerifyFunctionAttrs(const FunctionType *FT,
|
|||||||
if (Attr.Attrs & Attribute::StructRet)
|
if (Attr.Attrs & Attribute::StructRet)
|
||||||
Assert1(Attr.Index == 1, "Attribute sret not on first parameter!", V);
|
Assert1(Attr.Index == 1, "Attribute sret not on first parameter!", V);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Attributes FAttrs = Attrs.getFnAttributes();
|
||||||
|
for (unsigned i = 0;
|
||||||
|
i < array_lengthof(Attribute::MutuallyIncompatible); ++i) {
|
||||||
|
Attributes MutI = FAttrs & Attribute::MutuallyIncompatible[i];
|
||||||
|
Assert1(!(MutI & (MutI - 1)), "Attributes " +
|
||||||
|
Attribute::getAsString(MutI) + " are incompatible!", V);
|
||||||
|
}
|
||||||
|
|
||||||
|
Attributes RAttrs = Attrs.getRetAttributes();
|
||||||
|
for (unsigned i = 0;
|
||||||
|
i < array_lengthof(Attribute::MutuallyIncompatible); ++i) {
|
||||||
|
Attributes MutI = RAttrs & Attribute::MutuallyIncompatible[i];
|
||||||
|
Assert1(!(MutI & (MutI - 1)), "Attributes " +
|
||||||
|
Attribute::getAsString(MutI) + " are incompatible!", V);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool VerifyAttributeCount(const AttrListPtr &Attrs, unsigned Params) {
|
static bool VerifyAttributeCount(const AttrListPtr &Attrs, unsigned Params) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
; Test function notes
|
; Test function notes
|
||||||
; RUN: not llvm-as %s -o /dev/null -f |& grep "only one inline note"
|
; RUN: not llvm-as %s -o /dev/null -f |& grep "Attributes noinline alwaysinline are incompatible"
|
||||||
; XFAIL: *
|
|
||||||
define void @fn1() alwaysinline noinline {
|
define void @fn1() alwaysinline noinline {
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user