[llvm-commits] [dragonegg] r116921 - in /dragonegg/trunk: llvm-abi-default.cpp llvm-abi.h llvm-backend.cpp llvm-convert.cpp llvm-types.cpp x86/llvm-target.cpp
Duncan Sands
baldrick at free.fr
Wed Oct 20 02:40:49 PDT 2010
Author: baldrick
Date: Wed Oct 20 04:40:49 2010
New Revision: 116921
URL: http://llvm.org/viewvc/llvm-project?rev=116921&view=rev
Log:
Use the cast-to-void idiom rather than ATTRIBUTE_UNUSED in most places,
since it is more portable.
Modified:
dragonegg/trunk/llvm-abi-default.cpp
dragonegg/trunk/llvm-abi.h
dragonegg/trunk/llvm-backend.cpp
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-types.cpp
dragonegg/trunk/x86/llvm-target.cpp
Modified: dragonegg/trunk/llvm-abi-default.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi-default.cpp?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi-default.cpp (original)
+++ dragonegg/trunk/llvm-abi-default.cpp Wed Oct 20 04:40:49 2010
@@ -17,8 +17,8 @@
// doNotUseShadowReturn - Return true if the specified GCC type
// should not be returned using a pointer to struct parameter.
-bool doNotUseShadowReturn(tree type, tree fndecl,
- CallingConv::ID CC ATTRIBUTE_UNUSED) {
+bool doNotUseShadowReturn(tree type, tree fndecl, CallingConv::ID CC) {
+ (void)CC; // Otherwise unused - avoid compiler warning.
if (!TYPE_SIZE(type))
return false;
if (TREE_CODE(TYPE_SIZE(type)) != INTEGER_CST)
Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Wed Oct 20 04:40:49 2010
@@ -54,70 +54,84 @@
/// HandleScalarResult - This callback is invoked if the function returns a
/// simple scalar result value, which is of type RetTy.
- virtual void HandleScalarResult(const Type *RetTy ATTRIBUTE_UNUSED) {}
+ virtual void HandleScalarResult(const Type *RetTy) {
+ (void)RetTy; // Otherwise unused - avoid compiler warning.
+ }
/// HandleAggregateResultAsScalar - This callback is invoked if the function
/// returns an aggregate value by bit converting it to the specified scalar
/// type and returning that. The bit conversion should start at byte Offset
/// within the struct, and ScalarTy is not necessarily big enough to cover
/// the entire struct.
- virtual void HandleAggregateResultAsScalar(
- const Type *ScalarTy ATTRIBUTE_UNUSED,
- unsigned Offset ATTRIBUTE_UNUSED = 0) {}
+ virtual void HandleAggregateResultAsScalar(const Type *ScalarTy,
+ unsigned Offset = 0) {
+ (void)ScalarTy; (void)Offset; // Otherwise unused - avoid compiler warning.
+ }
/// HandleAggregateResultAsAggregate - This callback is invoked if the function
/// returns an aggregate value using multiple return values.
- virtual void HandleAggregateResultAsAggregate(
- const Type *AggrTy ATTRIBUTE_UNUSED) {}
+ virtual void HandleAggregateResultAsAggregate(const Type *AggrTy) {
+ (void)AggrTy; // Otherwise unused - avoid compiler warning.
+ }
/// HandleAggregateShadowResult - This callback is invoked if the function
/// returns an aggregate value by using a "shadow" first parameter, which is
/// a pointer to the aggregate, of type PtrArgTy. If RetPtr is set to true,
/// the pointer argument itself is returned from the function.
- virtual void HandleAggregateShadowResult(
- const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
- bool RetPtr ATTRIBUTE_UNUSED) {}
+ virtual void HandleAggregateShadowResult(const PointerType *PtrArgTy,
+ bool RetPtr) {
+ (void)PtrArgTy; (void)RetPtr; // Otherwise unused - avoid compiler warning.
+ }
/// HandleScalarShadowResult - This callback is invoked if the function
/// returns a scalar value by using a "shadow" first parameter, which is a
/// pointer to the scalar, of type PtrArgTy. If RetPtr is set to true,
/// the pointer argument itself is returned from the function.
- virtual void HandleScalarShadowResult(
- const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
- bool RetPtr ATTRIBUTE_UNUSED) {}
+ virtual void HandleScalarShadowResult(const PointerType *PtrArgTy,
+ bool RetPtr) {
+ (void)PtrArgTy; (void)RetPtr; // Otherwise unused - avoid compiler warning.
+ }
/// HandleScalarArgument - This is the primary callback that specifies an
/// LLVM argument to pass. It is only used for first class types.
/// If RealSize is non Zero then it specifies number of bytes to access
/// from LLVMTy.
- virtual void HandleScalarArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
- tree_node *type ATTRIBUTE_UNUSED,
- unsigned RealSize ATTRIBUTE_UNUSED = 0) {}
+ virtual void HandleScalarArgument(const llvm::Type *LLVMTy, tree_node *type,
+ unsigned RealSize = 0) {
+ (void)LLVMTy; (void)type;
+ (void)RealSize; // Otherwise unused - avoid compiler warning.
+ }
/// HandleByInvisibleReferenceArgument - This callback is invoked if a pointer
/// (of type PtrTy) to the argument is passed rather than the argument itself.
- virtual void HandleByInvisibleReferenceArgument(
- const llvm::Type *PtrTy ATTRIBUTE_UNUSED,
- tree_node *type ATTRIBUTE_UNUSED) {}
+ virtual void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy,
+ tree_node *type) {
+ (void)PtrTy; (void)type; // Otherwise unused - avoid compiler warning.
+ }
/// HandleByValArgument - This callback is invoked if the aggregate function
/// argument is passed by value.
- virtual void HandleByValArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
- tree_node *type ATTRIBUTE_UNUSED) {}
+ virtual void HandleByValArgument(const llvm::Type *LLVMTy, tree_node *type) {
+ (void)LLVMTy; (void)type; // Otherwise unused - avoid compiler warning.
+ }
/// HandleFCAArgument - This callback is invoked if the aggregate function
/// argument is passed by value as a first class aggregate.
- virtual void HandleFCAArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
- tree_node *type ATTRIBUTE_UNUSED) {}
+ virtual void HandleFCAArgument(const llvm::Type *LLVMTy, tree_node *type) {
+ (void)LLVMTy; (void)type; // Otherwise unused - avoid compiler warning.
+ }
/// EnterField - Called when we're about the enter the field of a struct
/// or union. FieldNo is the number of the element we are entering in the
/// LLVM Struct, StructTy is the LLVM type of the struct we are entering.
- virtual void EnterField(unsigned FieldNo ATTRIBUTE_UNUSED,
- const llvm::Type *StructTy ATTRIBUTE_UNUSED) {}
+ virtual void EnterField(unsigned FieldNo, const llvm::Type *StructTy) {
+ (void)FieldNo; (void)StructTy; // Otherwise unused - avoid compiler warning.
+ }
virtual void ExitField() {}
- virtual void HandlePad(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED) {}
+ virtual void HandlePad(const llvm::Type *LLVMTy) {
+ (void)LLVMTy; // Otherwise unused - avoid compiler warning.
+ }
};
// LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY - A hook to allow
@@ -183,8 +197,8 @@
// getLLVMAggregateTypeForStructReturn - Return LLVM type if TY can be
// returns as multiple values, otherwise return NULL. This is the default
// target independent implementation.
-static inline const Type* getLLVMAggregateTypeForStructReturn(
- tree_node *type ATTRIBUTE_UNUSED) {
+static inline const Type* getLLVMAggregateTypeForStructReturn(tree_node *type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
return NULL;
}
@@ -310,9 +324,11 @@
llvm_default_extract_multiple_return_value((Src),(Dest),(V),(B))
#endif
static inline
-void llvm_default_extract_multiple_return_value(
- Value *Src ATTRIBUTE_UNUSED, Value *Dest ATTRIBUTE_UNUSED,
- bool isVolatile ATTRIBUTE_UNUSED, LLVMBuilder &Builder ATTRIBUTE_UNUSED) {
+void llvm_default_extract_multiple_return_value(Value *Src, Value *Dest,
+ bool isVolatile,
+ LLVMBuilder &Builder) {
+ (void)Src; (void)Dest;
+ (void)isVolatile; (void)Builder; // Otherwise unused - avoid compiler warning.
assert (0 && "LLVM_EXTRACT_MULTIPLE_RETURN_VALUE is not implemented!");
}
Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Wed Oct 20 04:40:49 2010
@@ -296,7 +296,7 @@
// SizeOfGlobalMatchesDecl - Whether the size of the given global value is the
// same as that of the given GCC declaration. Conservatively returns 'true' if
// the answer is unclear.
-static ATTRIBUTE_UNUSED
+static ATTRIBUTE_UNUSED // Only called from asserts.
bool SizeOfGlobalMatchesDecl(GlobalValue *GV, tree decl) {
// If the GCC declaration has no size then nothing useful can be said here.
if (!DECL_SIZE(decl))
@@ -1556,8 +1556,9 @@
/// before processing the compilation unit.
/// NOTE: called even when only doing syntax checking, so do not initialize the
/// module etc here.
-static void llvm_start_unit(void *gcc_data ATTRIBUTE_UNUSED,
- void *user_data ATTRIBUTE_UNUSED) {
+static void llvm_start_unit(void *gcc_data, void *user_data) {
+ (void)gcc_data; (void)user_data; // Otherwise unused - avoid compiler warning.
+
if (!quiet_flag)
errs() << "Starting compilation unit\n";
@@ -1871,7 +1872,9 @@
/// emit_same_body_alias - Turn a same-body alias into LLVM IR.
static void emit_same_body_alias(struct cgraph_node *alias,
- struct cgraph_node *target ATTRIBUTE_UNUSED) {
+ struct cgraph_node *target) {
+ (void)target; // Otherwise unused - avoid compiler warning.
+
if (errorcount || sorrycount)
return; // Do not process broken code.
@@ -1965,11 +1968,13 @@
};
/// emit_variables - Output GCC global variables to the LLVM IR.
-static void emit_variables(cgraph_node_set set ATTRIBUTE_UNUSED
+static void emit_variables(cgraph_node_set set
#if (GCC_MINOR > 5)
, varpool_node_set vset ATTRIBUTE_UNUSED
#endif
) {
+ (void)set; // Otherwise unused - avoid compiler warning.
+
if (errorcount || sorrycount)
return; // Do not process broken code.
@@ -2099,15 +2104,16 @@
/// llvm_finish - Run shutdown code when GCC exits.
-static void llvm_finish(void *gcc_data ATTRIBUTE_UNUSED,
- void *user_data ATTRIBUTE_UNUSED) {
+static void llvm_finish(void *gcc_data, void *user_data) {
+ (void)gcc_data; (void)user_data; // Otherwise unused - avoid compiler warning.
FinalizePlugin();
}
/// llvm_finish_unit - Finish the .s file. This is called by GCC once the
/// compilation unit has been completely processed.
-static void llvm_finish_unit(void *gcc_data ATTRIBUTE_UNUSED,
- void *user_data ATTRIBUTE_UNUSED) {
+static void llvm_finish_unit(void *gcc_data, void *user_data) {
+ (void)gcc_data; (void)user_data; // Otherwise unused - avoid compiler warning.
+
if (errorcount || sorrycount)
return; // Do not process broken code.
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Wed Oct 20 04:40:49 2010
@@ -130,6 +130,7 @@
/// overflowed constants. These conditions can be checked by calling isInt64.
uint64_t getInt64(tree t, bool Unsigned) {
assert(isInt64(t, Unsigned) && "invalid constant!");
+ (void)Unsigned; // Otherwise unused if asserts off - avoid compiler warning.
return getINTEGER_CSTVal(t);
}
@@ -380,7 +381,8 @@
/// getCallingConv - This provides the desired CallingConv for the function.
CallingConv::ID& getCallingConv(void) { return CallingConv; }
- void HandlePad(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED) {
+ void HandlePad(const llvm::Type *LLVMTy) {
+ (void)LLVMTy; // Otherwise unused - avoid compiler warning.
++AI;
}
@@ -399,9 +401,8 @@
LocStack.clear();
}
- void HandleAggregateShadowResult(
- const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
- bool RetPtr ATTRIBUTE_UNUSED) {
+ void HandleAggregateShadowResult(const PointerType *PtrArgTy, bool RetPtr) {
+ (void)PtrArgTy; (void)RetPtr; // Otherwise unused - avoid compiler warning
// If the function returns a structure by value, we transform the function
// to take a pointer to the result as the first argument of the function
// instead.
@@ -435,8 +436,8 @@
++AI;
}
- void HandleScalarShadowResult(const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
- bool RetPtr ATTRIBUTE_UNUSED) {
+ void HandleScalarShadowResult(const PointerType *PtrArgTy, bool RetPtr) {
+ (void)PtrArgTy; (void)RetPtr; // Otherwise unused - avoid compiler warning
assert(AI != Builder.GetInsertBlock()->getParent()->arg_end() &&
"No explicit return value?");
AI->setName("scalar.result");
@@ -445,9 +446,9 @@
++AI;
}
- void HandleScalarArgument(const llvm::Type *LLVMTy,
- tree type ATTRIBUTE_UNUSED,
+ void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
unsigned RealSize = 0) {
+ (void)type; // Otherwise unused - avoid compiler warning.
Value *ArgVal = AI;
if (ArgVal->getType() != LLVMTy) {
if (ArgVal->getType()->isPointerTy() && LLVMTy->isPointerTy()) {
@@ -475,8 +476,8 @@
++AI;
}
- void HandleByValArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
+ (void)LLVMTy; (void)type; // Otherwise unused - avoid compiler warning.
if (LLVM_BYVAL_ALIGNMENT_TOO_SMALL(type)) {
// Incoming object on stack is insufficiently aligned for the type.
// Make a correctly aligned copy.
@@ -507,8 +508,8 @@
++AI;
}
- void HandleFCAArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleFCAArgument(const llvm::Type *LLVMTy, tree type) {
+ (void)LLVMTy; (void)type; // Otherwise unused - avoid compiler warning.
// Store the FCA argument into alloca.
assert(!LocStack.empty());
Value *Loc = LocStack.back();
@@ -517,8 +518,9 @@
++AI;
}
- void HandleAggregateResultAsScalar(const Type *ScalarTy ATTRIBUTE_UNUSED,
- unsigned Offset=0) {
+ void HandleAggregateResultAsScalar(const Type *ScalarTy,
+ unsigned Offset = 0) {
+ (void)ScalarTy; // Otherwise unused - avoid compiler warning.
this->Offset = Offset;
}
@@ -543,8 +545,8 @@
// passed in memory byval.
static bool isPassedByVal(tree type, const Type *Ty,
std::vector<const Type*> &ScalarArgs,
- bool isShadowRet,
- CallingConv::ID &CC ATTRIBUTE_UNUSED) {
+ bool isShadowRet, CallingConv::ID &CC) {
+ (void)CC; // Otherwise unused - avoid compiler warning.
if (LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(type, Ty))
return true;
@@ -2600,7 +2602,8 @@
/// HandleScalarResult - This callback is invoked if the function returns a
/// simple scalar result value.
- void HandleScalarResult(const Type *RetTy ATTRIBUTE_UNUSED) {
+ void HandleScalarResult(const Type *RetTy) {
+ (void)RetTy; // Otherwise unused - avoid compiler warning.
// There is nothing to do here if we return a scalar or void.
assert(DestLoc == 0 &&
"Call returns a scalar but caller expects aggregate!");
@@ -2609,14 +2612,16 @@
/// HandleAggregateResultAsScalar - This callback is invoked if the function
/// returns an aggregate value by bit converting it to the specified scalar
/// type and returning that.
- void HandleAggregateResultAsScalar(const Type *ScalarTy ATTRIBUTE_UNUSED,
+ void HandleAggregateResultAsScalar(const Type *ScalarTy,
unsigned Offset = 0) {
+ (void)ScalarTy; // Otherwise unused - avoid compiler warning.
this->Offset = Offset;
}
/// HandleAggregateResultAsAggregate - This callback is invoked if the
/// function returns an aggregate value using multiple return values.
- void HandleAggregateResultAsAggregate(const Type *AggrTy ATTRIBUTE_UNUSED) {
+ void HandleAggregateResultAsAggregate(const Type *AggrTy) {
+ (void)AggrTy; // Otherwise unused - avoid compiler warning.
// There is nothing to do here.
isAggrRet = true;
}
@@ -2625,8 +2630,8 @@
/// returns an aggregate value by using a "shadow" first parameter. If
/// RetPtr is set to true, the pointer argument itself is returned from the
/// function.
- void HandleAggregateShadowResult(const PointerType *PtrArgTy,
- bool RetPtr ATTRIBUTE_UNUSED) {
+ void HandleAggregateShadowResult(const PointerType *PtrArgTy, bool RetPtr) {
+ (void)RetPtr; // Otherwise unused - avoid compiler warning.
// We need to pass memory to write the return value into.
// FIXME: alignment and volatility are being ignored!
assert(!DestLoc || PtrArgTy == DestLoc->Ptr->getType());
@@ -2659,8 +2664,8 @@
/// returns a scalar value by using a "shadow" first parameter, which is a
/// pointer to the scalar, of type PtrArgTy. If RetPtr is set to true,
/// the pointer argument itself is returned from the function.
- void HandleScalarShadowResult(const PointerType *PtrArgTy,
- bool RetPtr ATTRIBUTE_UNUSED) {
+ void HandleScalarShadowResult(const PointerType *PtrArgTy, bool RetPtr) {
+ (void)RetPtr; // Otherwise unused - avoid compiler warning.
assert(DestLoc == 0 &&
"Call returns a scalar but caller expects aggregate!");
// Create a buffer to hold the result. The result will be loaded out of
@@ -2700,7 +2705,8 @@
/// pointer (of type PtrTy) to the argument is passed rather than the
/// argument itself.
void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy,
- tree type ATTRIBUTE_UNUSED) {
+ tree type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
Value *Loc = getAddress();
Loc = Builder.CreateBitCast(Loc, PtrTy);
CallOperands.push_back(Loc);
@@ -2709,19 +2715,21 @@
/// HandleByValArgument - This callback is invoked if the aggregate function
/// argument is passed by value. It is lowered to a parameter passed by
/// reference with an additional parameter attribute "ByVal".
- void HandleByValArgument(const llvm::Type *LLVMTy,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
Value *Loc = getAddress();
assert(LLVMTy->getPointerTo() == Loc->getType());
+ (void)LLVMTy; // Otherwise unused if asserts off - avoid compiler warning.
CallOperands.push_back(Loc);
}
/// HandleFCAArgument - This callback is invoked if the aggregate function
/// argument is passed as a first class aggregate.
- void HandleFCAArgument(const llvm::Type *LLVMTy,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleFCAArgument(const llvm::Type *LLVMTy, tree type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
Value *Loc = getAddress();
assert(LLVMTy->getPointerTo() == Loc->getType());
+ (void)LLVMTy; // Otherwise unused if asserts off - avoid compiler warning.
CallOperands.push_back(Builder.CreateLoad(Loc));
}
@@ -4638,8 +4646,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinBZero(gimple stmt,
- Value *&Result ATTRIBUTE_UNUSED) {
+bool TreeToLLVM::EmitBuiltinBZero(gimple stmt, Value *&Result) {
+ (void)Result; // Otherwise unused - avoid compiler warning.
if (!validate_gimple_arglist(stmt, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return false;
@@ -4863,8 +4871,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinEHReturn(gimple stmt,
- Value *&Result ATTRIBUTE_UNUSED) {
+bool TreeToLLVM::EmitBuiltinEHReturn(gimple stmt, Value *&Result) {
+ (void)Result; // Otherwise unused - avoid compiler warning.
if (!validate_gimple_arglist(stmt, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE))
return false;
@@ -4886,8 +4894,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinInitDwarfRegSizes(gimple stmt,
- Value *&Result ATTRIBUTE_UNUSED) {
+bool TreeToLLVM::EmitBuiltinInitDwarfRegSizes(gimple stmt, Value *&Result) {
+ (void)Result; // Otherwise unused - avoid compiler warning.
#ifdef DWARF2_UNWIND_INFO
unsigned int i;
bool wrote_return_column = false;
@@ -4953,8 +4961,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinUnwindInit(gimple stmt,
- Value *&Result ATTRIBUTE_UNUSED) {
+bool TreeToLLVM::EmitBuiltinUnwindInit(gimple stmt, Value *&Result) {
+ (void)Result; // Otherwise unused - avoid compiler warning.
if (!validate_gimple_arglist(stmt, VOID_TYPE))
return false;
@@ -5075,8 +5083,8 @@
return true;
}
-bool TreeToLLVM::EmitBuiltinInitTrampoline(gimple stmt,
- Value *&Result ATTRIBUTE_UNUSED) {
+bool TreeToLLVM::EmitBuiltinInitTrampoline(gimple stmt, Value *&Result) {
+ (void)Result; // Otherwise unused - avoid compiler warning.
if (!validate_gimple_arglist(stmt, POINTER_TYPE, POINTER_TYPE, POINTER_TYPE,
VOID_TYPE))
return false;
Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Wed Oct 20 04:40:49 2010
@@ -1027,7 +1027,8 @@
}
void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
- unsigned RealSize ATTRIBUTE_UNUSED = 0) {
+ unsigned RealSize = 0) {
+ (void)RealSize; // Otherwise unused - avoid compiler warning.
if (KNRPromotion) {
if (type == float_type_node)
LLVMTy = ConvertType(double_type_node);
@@ -1040,8 +1041,8 @@
/// HandleByInvisibleReferenceArgument - This callback is invoked if a pointer
/// (of type PtrTy) to the argument is passed rather than the argument itself.
- void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy, tree type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
ArgTypes.push_back(PtrTy);
}
@@ -1054,8 +1055,8 @@
/// HandleFCAArgument - This callback is invoked if the aggregate function
/// argument is a first class aggregate passed by value.
- void HandleFCAArgument(const llvm::Type *LLVMTy,
- tree type ATTRIBUTE_UNUSED) {
+ void HandleFCAArgument(const llvm::Type *LLVMTy, tree type) {
+ (void)type; // Otherwise unused - avoid compiler warning.
ArgTypes.push_back(LLVMTy);
}
};
@@ -1461,9 +1462,9 @@
/// includes the specified byte, remove it. Return true struct
/// layout is sized properly. Return false if unable to handle ByteOffset.
/// In this case caller should redo this struct as a packed structure.
- bool ResizeLastElementIfOverlapsWith(uint64_t ByteOffset,
- tree Field ATTRIBUTE_UNUSED,
+ bool ResizeLastElementIfOverlapsWith(uint64_t ByteOffset, tree Field,
const Type *Ty) {
+ (void)Field; // Otherwise unused - avoid compiler warning.
const Type *SavedTy = NULL;
if (!Elements.empty()) {
Modified: dragonegg/trunk/x86/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.cpp?rev=116921&r1=116920&r2=116921&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.cpp (original)
+++ dragonegg/trunk/x86/llvm-target.cpp Wed Oct 20 04:40:49 2010
@@ -88,10 +88,11 @@
*/
bool TreeToLLVM::TargetIntrinsicLower(gimple stmt,
tree fndecl,
- const MemRef *DestLoc ATTRIBUTE_UNUSED,
+ const MemRef *DestLoc,
Value *&Result,
const Type *ResultType,
std::vector<Value*> &Ops) {
+ (void)DestLoc; // Otherwise unused - avoid compiler warning.
// DECL_FUNCTION_CODE contains a value of the enumerated type ix86_builtins,
// declared in i386.c. If this type was visible to us then we could simply
// use a switch statement on DECL_FUNCTION_CODE to jump to the right code for
@@ -1325,9 +1326,9 @@
/// The original implementation of this routine is based on
/// llvm_x86_64_should_pass_aggregate_in_mixed_regs code.
void
-llvm_x86_64_get_multiple_return_reg_classes(tree TreeType,
- const Type *Ty ATTRIBUTE_UNUSED,
+llvm_x86_64_get_multiple_return_reg_classes(tree TreeType, const Type *Ty,
std::vector<const Type*> &Elts) {
+ (void)Ty; // Otherwise unused - avoid compiler warning.
enum x86_64_reg_class Class[MAX_CLASSES];
enum machine_mode Mode = type_natural_mode(TreeType, NULL);
HOST_WIDE_INT Bytes =
More information about the llvm-commits
mailing list