[llvm-commits] [dragonegg] r170501 - in /dragonegg/trunk: include/x86/dragonegg/Target.h src/Backend.cpp src/Convert.cpp src/DefaultABI.cpp src/TypeConversion.cpp
Bill Wendling
isanbard at gmail.com
Tue Dec 18 23:18:46 PST 2012
Author: void
Date: Wed Dec 19 01:18:46 2012
New Revision: 170501
URL: http://llvm.org/viewvc/llvm-project?rev=170501&view=rev
Log:
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
Modified:
dragonegg/trunk/include/x86/dragonegg/Target.h
dragonegg/trunk/src/Backend.cpp
dragonegg/trunk/src/Convert.cpp
dragonegg/trunk/src/DefaultABI.cpp
dragonegg/trunk/src/TypeConversion.cpp
Modified: dragonegg/trunk/include/x86/dragonegg/Target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/x86/dragonegg/Target.h?rev=170501&r1=170500&r2=170501&view=diff
==============================================================================
--- dragonegg/trunk/include/x86/dragonegg/Target.h (original)
+++ dragonegg/trunk/include/x86/dragonegg/Target.h Wed Dec 19 01:18:46 2012
@@ -43,7 +43,7 @@
tree_node *type_attributes = TYPE_ATTRIBUTES (type); \
if (!TARGET_64BIT && (TARGET_SSEREGPARM || \
lookup_attribute("sseregparm", type_attributes))) \
- AttrBuilder.addAttribute(Attributes::InReg); \
+ AttrBuilder.addAttribute(Attribute::InReg); \
}
/* LLVM specific stuff for converting gcc's `regparm` attribute to LLVM's
@@ -86,7 +86,7 @@
TYPE_PRECISION(Type)==64)) { \
local_fp_regparm -= 1; \
if (local_fp_regparm >= 0) \
- AttrBuilder.addAttribute(Attributes::InReg); \
+ AttrBuilder.addAttribute(Attribute::InReg); \
else \
local_fp_regparm = 0; \
} else if (isa<INTEGRAL_TYPE>(Type) || \
@@ -95,7 +95,7 @@
(Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \
local_regparm -= words; \
if (local_regparm>=0) \
- AttrBuilder.addAttribute(Attributes::InReg); \
+ AttrBuilder.addAttribute(Attribute::InReg); \
else \
local_regparm = 0; \
} \
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=170501&r1=170500&r2=170501&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Wed Dec 19 01:18:46 2012
@@ -705,7 +705,7 @@
// TODO: Consider letting the GCC inliner do this.
for (Module::iterator I = TheModule->begin(), E = TheModule->end();
I != E; ++I)
- if (I->getFnAttributes().hasAttribute(Attributes::AlwaysInline)) {
+ if (I->getFnAttributes().hasAttribute(Attribute::AlwaysInline)) {
NeedAlwaysInliner = true;
break;
}
@@ -1826,9 +1826,9 @@
//TODO I != E; ++I)
//TODO if (!I->isDeclaration()) {
//TODO if (flag_disable_red_zone)
-//TODO I->addFnAttr(Attributes::NoRedZone);
+//TODO I->addFnAttr(Attribute::NoRedZone);
//TODO if (flag_no_implicit_float)
-//TODO I->addFnAttr(Attributes::NoImplicitFloat);
+//TODO I->addFnAttr(Attribute::NoImplicitFloat);
//TODO }
// Add an llvm.global_ctors global if needed.
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=170501&r1=170500&r2=170501&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Wed Dec 19 01:18:46 2012
@@ -1024,28 +1024,28 @@
// Handle noinline Functions
if (lookup_attribute ("noinline", DECL_ATTRIBUTES (FnDecl)))
- Fn->addFnAttr(Attributes::NoInline);
+ Fn->addFnAttr(Attribute::NoInline);
// Handle always_inline attribute
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl)))
- Fn->addFnAttr(Attributes::AlwaysInline);
+ Fn->addFnAttr(Attribute::AlwaysInline);
// Pass inline keyword to optimizer.
if (DECL_DECLARED_INLINE_P(FnDecl))
- Fn->addFnAttr(Attributes::InlineHint);
+ Fn->addFnAttr(Attribute::InlineHint);
if (optimize_size)
- Fn->addFnAttr(Attributes::OptimizeForSize);
+ Fn->addFnAttr(Attribute::OptimizeForSize);
// Handle stack smashing protection.
if (flag_stack_protect == 1)
- Fn->addFnAttr(Attributes::StackProtect);
+ Fn->addFnAttr(Attribute::StackProtect);
else if (flag_stack_protect == 2)
- Fn->addFnAttr(Attributes::StackProtectReq);
+ Fn->addFnAttr(Attribute::StackProtectReq);
// Handle naked attribute
if (lookup_attribute ("naked", DECL_ATTRIBUTES (FnDecl)))
- Fn->addFnAttr(Attributes::Naked);
+ Fn->addFnAttr(Attribute::Naked);
// Handle annotate attributes
if (DECL_ATTRIBUTES(FnDecl))
@@ -3271,12 +3271,12 @@
// Work out whether to use an invoke or an ordinary call.
if (!stmt_could_throw_p(stmt)) {
// This call does not throw - mark it 'nounwind'.
- Attributes NoUnwind = Attributes::get(Callee->getContext(),
- Attributes::NoUnwind);
+ Attribute NoUnwind = Attribute::get(Callee->getContext(),
+ Attribute::NoUnwind);
PAL = PAL.addAttr(Callee->getContext(), ~0, NoUnwind);
}
- if (!PAL.getFnAttributes().hasAttribute(Attributes::NoUnwind)) {
+ if (!PAL.getFnAttributes().hasAttribute(Attribute::NoUnwind)) {
// This call may throw. Determine if we need to generate
// an invoke rather than a simple call.
LPadNo = lookup_stmt_eh_lp(stmt);
@@ -3373,7 +3373,7 @@
// If the argument is split into multiple scalars, assign the
// attributes to all scalars of the aggregate.
for (unsigned j = OldSize + 1; j <= CallOperands.size(); ++j)
- PAL = PAL.addAttr(Context, j, Attributes::get(Context, AttrBuilder));
+ PAL = PAL.addAttr(Context, j, Attribute::get(Context, AttrBuilder));
}
Client.clear();
Modified: dragonegg/trunk/src/DefaultABI.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/DefaultABI.cpp?rev=170501&r1=170500&r2=170501&view=diff
==============================================================================
--- dragonegg/trunk/src/DefaultABI.cpp (original)
+++ dragonegg/trunk/src/DefaultABI.cpp Wed Dec 19 01:18:46 2012
@@ -214,7 +214,7 @@
} else if (LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(type)) {
C.HandleByValArgument(Ty, type);
if (AttrBuilder) {
- AttrBuilder->addAttribute(Attributes::ByVal);
+ AttrBuilder->addAttribute(Attribute::ByVal);
AttrBuilder->addAlignmentAttr(LLVM_BYVAL_ALIGNMENT(type));
}
} else {
@@ -239,14 +239,14 @@
else {
C.HandleByValArgument(Ty, type);
if (AttrBuilder) {
- AttrBuilder->addAttribute(Attributes::ByVal);
+ AttrBuilder->addAttribute(Attribute::ByVal);
AttrBuilder->addAlignmentAttr(LLVM_BYVAL_ALIGNMENT(type));
}
}
} else if (LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(type, Ty)) {
C.HandleByValArgument(Ty, type);
if (AttrBuilder) {
- AttrBuilder->addAttribute(Attributes::ByVal);
+ AttrBuilder->addAttribute(Attribute::ByVal);
AttrBuilder->addAlignmentAttr(LLVM_BYVAL_ALIGNMENT(type));
}
} else if (LLVM_SHOULD_PASS_AGGREGATE_IN_INTEGER_REGS(type, &Size,
Modified: dragonegg/trunk/src/TypeConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/TypeConversion.cpp?rev=170501&r1=170500&r2=170501&view=diff
==============================================================================
--- dragonegg/trunk/src/TypeConversion.cpp (original)
+++ dragonegg/trunk/src/TypeConversion.cpp Wed Dec 19 01:18:46 2012
@@ -640,13 +640,13 @@
static void HandleArgumentExtension(tree ArgTy, AttrBuilder &AttrBuilder) {
if (isa<BOOLEAN_TYPE>(ArgTy)) {
if (TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)) < INT_TYPE_SIZE)
- AttrBuilder.addAttribute(Attributes::ZExt);
+ AttrBuilder.addAttribute(Attribute::ZExt);
} else if (isa<INTEGER_TYPE>(ArgTy) &&
TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)) < INT_TYPE_SIZE) {
if (TYPE_UNSIGNED(ArgTy))
- AttrBuilder.addAttribute(Attributes::ZExt);
+ AttrBuilder.addAttribute(Attribute::ZExt);
else
- AttrBuilder.addAttribute(Attributes::SExt);
+ AttrBuilder.addAttribute(Attribute::SExt);
}
}
@@ -687,17 +687,17 @@
#endif
if (RAttrBuilder.hasAttributes())
- Attrs.push_back(AttributeWithIndex::get(0, Attributes::get(Context,
- RAttrBuilder)));
+ Attrs.push_back(AttributeWithIndex::get(0, Attribute::get(Context,
+ RAttrBuilder)));
// If this function returns via a shadow argument, the dest loc is passed
// in as a pointer. Mark that pointer as struct-ret and noalias.
if (ABIConverter.isShadowReturn()) {
AttrBuilder B;
- B.addAttribute(Attributes::StructRet)
- .addAttribute(Attributes::NoAlias);
+ B.addAttribute(Attribute::StructRet)
+ .addAttribute(Attribute::NoAlias);
Attrs.push_back(AttributeWithIndex::get(ArgTys.size(),
- Attributes::get(Context, B)));
+ Attribute::get(Context, B)));
}
std::vector<Type*> ScalarArgs;
@@ -705,7 +705,7 @@
// Pass the static chain as the first parameter.
ABIConverter.HandleArgument(TREE_TYPE(static_chain), ScalarArgs);
// Mark it as the chain argument.
- Attributes Nest = Attributes::get(Context, Attributes::Nest);
+ Attribute Nest = Attribute::get(Context, Attribute::Nest);
Attrs.push_back(AttributeWithIndex::get(ArgTys.size(), Nest));
}
@@ -722,12 +722,12 @@
// Compute noalias attributes.
if (isa<ACCESS_TYPE>(ArgTy) && TYPE_RESTRICT(ArgTy))
- PAttrBuilder.addAttribute(Attributes::NoAlias);
+ PAttrBuilder.addAttribute(Attribute::NoAlias);
if (PAttrBuilder.hasAttributes())
Attrs.push_back(AttributeWithIndex::get(ArgTys.size(),
- Attributes::get(Context,
- PAttrBuilder)));
+ Attribute::get(Context,
+ PAttrBuilder)));
}
PAL = AttributeSet::get(Context, Attrs);
@@ -758,36 +758,36 @@
// Check for 'readnone' and 'readonly' function attributes.
if (flags & ECF_CONST)
- FnAttrBuilder.addAttribute(Attributes::ReadNone);
+ FnAttrBuilder.addAttribute(Attribute::ReadNone);
else if (flags & ECF_PURE)
- FnAttrBuilder.addAttribute(Attributes::ReadOnly);
+ FnAttrBuilder.addAttribute(Attribute::ReadOnly);
// TODO: Handle ECF_LOOPING_CONST_OR_PURE
// Check for 'noreturn' function attribute.
if (flags & ECF_NORETURN)
- FnAttrBuilder.addAttribute(Attributes::NoReturn);
+ FnAttrBuilder.addAttribute(Attribute::NoReturn);
// Check for 'nounwind' function attribute.
if (flags & ECF_NOTHROW)
- FnAttrBuilder.addAttribute(Attributes::NoUnwind);
+ FnAttrBuilder.addAttribute(Attribute::NoUnwind);
// Check for 'returnstwice' function attribute.
if (flags & ECF_RETURNS_TWICE)
- FnAttrBuilder.addAttribute(Attributes::ReturnsTwice);
+ FnAttrBuilder.addAttribute(Attribute::ReturnsTwice);
// Since they write the return value through a pointer,
// 'sret' functions cannot be 'readnone' or 'readonly'.
if (ABIConverter.isShadowReturn()) {
- FnAttrBuilder.removeAttribute(Attributes::ReadNone)
- .removeAttribute(Attributes::ReadOnly);
+ FnAttrBuilder.removeAttribute(Attribute::ReadNone)
+ .removeAttribute(Attribute::ReadOnly);
}
// Demote 'readnone' nested functions to 'readonly' since
// they may need to read through the static chain.
- if (static_chain && FnAttrBuilder.hasAttribute(Attributes::ReadNone)) {
- FnAttrBuilder.removeAttribute(Attributes::ReadNone);
- FnAttrBuilder.addAttribute(Attributes::ReadOnly);
+ if (static_chain && FnAttrBuilder.hasAttribute(Attribute::ReadNone)) {
+ FnAttrBuilder.removeAttribute(Attribute::ReadNone);
+ FnAttrBuilder.addAttribute(Attribute::ReadOnly);
}
// Compute whether the result needs to be zext or sext'd.
@@ -802,20 +802,20 @@
// The value returned by a 'malloc' function does not alias anything.
if (flags & ECF_MALLOC)
- RAttrBuilder.addAttribute(Attributes::NoAlias);
+ RAttrBuilder.addAttribute(Attribute::NoAlias);
if (RAttrBuilder.hasAttributes())
- Attrs.push_back(AttributeWithIndex::get(0, Attributes::get(Context,
- RAttrBuilder)));
+ Attrs.push_back(AttributeWithIndex::get(0, Attribute::get(Context,
+ RAttrBuilder)));
// If this function returns via a shadow argument, the dest loc is passed
// in as a pointer. Mark that pointer as struct-ret and noalias.
if (ABIConverter.isShadowReturn()) {
AttrBuilder B;
- B.addAttribute(Attributes::StructRet)
- .addAttribute(Attributes::NoAlias);
+ B.addAttribute(Attribute::StructRet)
+ .addAttribute(Attribute::NoAlias);
Attrs.push_back(AttributeWithIndex::get(ArgTypes.size(),
- Attributes::get(Context, B)));
+ Attribute::get(Context, B)));
}
std::vector<Type*> ScalarArgs;
@@ -823,7 +823,7 @@
// Pass the static chain as the first parameter.
ABIConverter.HandleArgument(TREE_TYPE(static_chain), ScalarArgs);
// Mark it as the chain argument.
- Attributes Nest = Attributes::get(Context, Attributes::Nest);
+ Attribute Nest = Attribute::get(Context, Attribute::Nest);
Attrs.push_back(AttributeWithIndex::get(ArgTypes.size(), Nest));
}
@@ -874,7 +874,7 @@
// types.
tree RestrictArgTy = (DeclArgs) ? TREE_TYPE(DeclArgs) : ArgTy;
if (isa<ACCESS_TYPE>(RestrictArgTy) && TYPE_RESTRICT(RestrictArgTy))
- PAttrBuilder.addAttribute(Attributes::NoAlias);
+ PAttrBuilder.addAttribute(Attribute::NoAlias);
#ifdef LLVM_TARGET_ENABLE_REGPARM
// Allow the target to mark this as inreg.
@@ -886,13 +886,13 @@
#endif // LLVM_TARGET_ENABLE_REGPARM
if (PAttrBuilder.hasAttributes()) {
- HasByVal |= PAttrBuilder.hasAttribute(Attributes::ByVal);
+ HasByVal |= PAttrBuilder.hasAttribute(Attribute::ByVal);
// If the argument is split into multiple scalars, assign the
// attributes to all scalars of the aggregate.
for (unsigned i = OldSize + 1; i <= ArgTypes.size(); ++i)
Attrs.push_back(AttributeWithIndex::get
- (i, Attributes::get(Context, PAttrBuilder)));
+ (i, Attribute::get(Context, PAttrBuilder)));
}
if (DeclArgs)
@@ -905,15 +905,15 @@
// write through the byval pointer argument, which LLVM does not allow for
// readonly/readnone functions.
if (HasByVal)
- FnAttrBuilder.removeAttribute(Attributes::ReadNone)
- .removeAttribute(Attributes::ReadOnly);
+ FnAttrBuilder.removeAttribute(Attribute::ReadNone)
+ .removeAttribute(Attribute::ReadOnly);
assert(RetTy && "Return type not specified!");
if (FnAttrBuilder.hasAttributes())
Attrs.push_back(AttributeWithIndex::get(~0,
- Attributes::get(Context,
- FnAttrBuilder)));
+ Attribute::get(Context,
+ FnAttrBuilder)));
// Finally, make the function type and result attributes.
PAL = AttributeSet::get(Context, Attrs);
More information about the llvm-commits
mailing list