[llvm-commits] [dragonegg] r114833 - in /dragonegg/trunk: Makefile llvm-abi.h llvm-convert.cpp llvm-debug.cpp llvm-debug.h
Duncan Sands
baldrick at free.fr
Mon Sep 27 09:33:01 PDT 2010
Author: baldrick
Date: Mon Sep 27 11:33:01 2010
New Revision: 114833
URL: http://llvm.org/viewvc/llvm-project?rev=114833&view=rev
Log:
Make the build -Wextra clean (and add -Wextra to the list of compile
flags).
Modified:
dragonegg/trunk/Makefile
dragonegg/trunk/llvm-abi.h
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-debug.cpp
dragonegg/trunk/llvm-debug.h
Modified: dragonegg/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Makefile?rev=114833&r1=114832&r2=114833&view=diff
==============================================================================
--- dragonegg/trunk/Makefile (original)
+++ dragonegg/trunk/Makefile Mon Sep 27 11:33:01 2010
@@ -17,8 +17,9 @@
QUIET:=@
endif
-CFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cflags) -fvisibility=hidden
-CXXFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cxxflags) -fvisibility=hidden
+COMMON_FLAGS=-Wall -Wextra -fvisibility=hidden
+CFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cflags)
+CXXFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags)
ifeq ($(shell uname),Darwin)
LOADABLE_MODULE_OPTIONS=-bundle -undefined dynamic_lookup
Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=114833&r1=114832&r2=114833&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Mon Sep 27 11:33:01 2010
@@ -54,59 +54,70 @@
/// 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) {}
+ virtual void HandleScalarResult(const Type *RetTy ATTRIBUTE_UNUSED) {}
/// 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, unsigned Offset=0) {}
+ virtual void HandleAggregateResultAsScalar(
+ const Type *ScalarTy ATTRIBUTE_UNUSED,
+ unsigned Offset ATTRIBUTE_UNUSED = 0) {}
/// HandleAggregateResultAsAggregate - This callback is invoked if the function
/// returns an aggregate value using multiple return values.
- virtual void HandleAggregateResultAsAggregate(const Type *AggrTy) {}
+ virtual void HandleAggregateResultAsAggregate(
+ const Type *AggrTy ATTRIBUTE_UNUSED) {}
/// 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, bool RetPtr){}
+ virtual void HandleAggregateShadowResult(
+ const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
+ bool RetPtr ATTRIBUTE_UNUSED) {}
/// 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, bool RetPtr) {}
+ virtual void HandleScalarShadowResult(
+ const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
+ bool RetPtr ATTRIBUTE_UNUSED) {}
/// 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, tree_node *type,
- unsigned RealSize = 0) {}
+ virtual void HandleScalarArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
+ tree_node *type ATTRIBUTE_UNUSED,
+ unsigned RealSize ATTRIBUTE_UNUSED = 0) {}
/// 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,
- tree_node *type) {}
+ virtual void HandleByInvisibleReferenceArgument(
+ const llvm::Type *PtrTy ATTRIBUTE_UNUSED,
+ tree_node *type ATTRIBUTE_UNUSED) {}
/// HandleByValArgument - This callback is invoked if the aggregate function
/// argument is passed by value.
- virtual void HandleByValArgument(const llvm::Type *LLVMTy, tree_node *type) {}
+ virtual void HandleByValArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
+ tree_node *type ATTRIBUTE_UNUSED) {}
/// 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,
+ virtual void HandleFCAArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
tree_node *type ATTRIBUTE_UNUSED) {}
/// 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, const llvm::Type *StructTy) {}
+ virtual void EnterField(unsigned FieldNo ATTRIBUTE_UNUSED,
+ const llvm::Type *StructTy ATTRIBUTE_UNUSED) {}
virtual void ExitField() {}
- virtual void HandlePad(const llvm::Type *LLVMTy) {}
+ virtual void HandlePad(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED) {}
};
// LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY - A hook to allow
@@ -172,7 +183,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) {
+static inline const Type* getLLVMAggregateTypeForStructReturn(
+ tree_node *type ATTRIBUTE_UNUSED) {
return NULL;
}
@@ -298,9 +310,9 @@
llvm_default_extract_multiple_return_value((Src),(Dest),(V),(B))
#endif
static inline
-void llvm_default_extract_multiple_return_value(Value *Src, Value *Dest,
- bool isVolatile,
- LLVMBuilder &Builder) {
+void llvm_default_extract_multiple_return_value(
+ Value *Src ATTRIBUTE_UNUSED, Value *Dest ATTRIBUTE_UNUSED,
+ bool isVolatile ATTRIBUTE_UNUSED, LLVMBuilder &Builder ATTRIBUTE_UNUSED) {
assert (0 && "LLVM_EXTRACT_MULTIPLE_RETURN_VALUE is not implemented!");
}
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=114833&r1=114832&r2=114833&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Mon Sep 27 11:33:01 2010
@@ -685,7 +685,7 @@
Builder.SetInsertPoint(EntryBlock);
if (EmitDebugInfo())
- TheDebugInfo->EmitFunctionStart(FnDecl, Fn, Builder.GetInsertBlock());
+ TheDebugInfo->EmitFunctionStart(FnDecl, Fn);
// Loop over all of the arguments to the function, setting Argument names and
// creating argument alloca's for the PARM_DECLs in case their address is
@@ -773,7 +773,7 @@
}
if (EmitDebugInfo())
- TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+ TheDebugInfo->EmitStopPoint(Builder.GetInsertBlock(), Builder);
// Create a new block for the return node, but don't insert it yet.
ReturnBB = BasicBlock::Create(Context, "return");
@@ -981,8 +981,8 @@
// call to PopulatePhiNodes (for example) generates complicated debug info,
// then the debug info logic barfs. Testcases showing this are 20011126-2.c
// or pr42221.c from the gcc testsuite compiled with -g -O3.
- TheDebugInfo->EmitStopPoint(Fn, ReturnBB, Builder);
- TheDebugInfo->EmitFunctionEnd(ReturnBB, true);
+ TheDebugInfo->EmitStopPoint(ReturnBB, Builder);
+ TheDebugInfo->EmitFunctionEnd(true);
}
#ifndef NDEBUG
@@ -1111,7 +1111,7 @@
TheDebugInfo->setLocationFile("");
TheDebugInfo->setLocationLine(0);
}
- TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+ TheDebugInfo->EmitStopPoint(Builder.GetInsertBlock(), Builder);
}
switch (gimple_code(stmt)) {
@@ -1169,7 +1169,7 @@
if (EmitDebugInfo()) {
TheDebugInfo->setLocationFile("");
TheDebugInfo->setLocationLine(0);
- TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+ TheDebugInfo->EmitStopPoint(Builder.GetInsertBlock(), Builder);
}
// Add a branch to the fallthru block.
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=114833&r1=114832&r2=114833&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Mon Sep 27 11:33:01 2010
@@ -161,7 +161,7 @@
/// whether the node is a TYPE or DECL. UseStub is true if we should consider
/// the type stub as the actually location (ignored in struct/unions/enums.)
static expanded_location GetNodeLocation(tree Node, bool UseStub = true) {
- expanded_location Location = { NULL, 0 };
+ expanded_location Location = { NULL, 0, 0, false };
if (Node == NULL_TREE)
return Location;
@@ -246,9 +246,7 @@
}
/// EmitFunctionStart - Constructs the debug code for entering a function.
-void DebugInfo::EmitFunctionStart(tree FnDecl, Function *Fn,
- BasicBlock *CurBB) {
-
+void DebugInfo::EmitFunctionStart(tree FnDecl, Function *Fn) {
DIType FNType = getOrCreateType(TREE_TYPE(FnDecl));
std::map<tree_node *, WeakVH >::iterator I = SPCache.find(FnDecl);
@@ -371,7 +369,7 @@
}
/// EmitFunctionEnd - Pop the region stack and reset current lexical block.
-void DebugInfo::EmitFunctionEnd(BasicBlock *CurBB, bool EndFunction) {
+void DebugInfo::EmitFunctionEnd(bool EndFunction) {
assert(!RegionStack.empty() && "Region stack mismatch, stack empty!");
RegionStack.pop_back();
// Blocks get erased; clearing these is needed for determinism, and also
@@ -417,8 +415,7 @@
}
/// EmitStopPoint - Set current source location.
-void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB,
- LLVMBuilder &Builder) {
+void DebugInfo::EmitStopPoint(BasicBlock *CurBB, LLVMBuilder &Builder) {
// Don't bother if things are the same as last time.
if (PrevLineNo == CurLineNo &&
PrevBB == CurBB &&
@@ -703,7 +700,7 @@
llvm::DIArray EltArray =
DebugFactory.GetOrCreateArray(Elements.data(), Elements.size());
- expanded_location Loc = { NULL, 0 };
+ expanded_location Loc = { NULL, 0, 0, false };
if (TYPE_SIZE(type))
// Incomplete enums do not have any location info.
Loc = GetNodeLocation(TREE_CHAIN(type), false);
Modified: dragonegg/trunk/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.h?rev=114833&r1=114832&r2=114833&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.h (original)
+++ dragonegg/trunk/llvm-debug.h Mon Sep 27 11:33:01 2010
@@ -102,11 +102,11 @@
/// EmitFunctionStart - Constructs the debug code for entering a function -
/// "llvm.dbg.func.start."
- void EmitFunctionStart(tree_node *FnDecl, Function *Fn, BasicBlock *CurBB);
+ void EmitFunctionStart(tree_node *FnDecl, Function *Fn);
/// EmitFunctionEnd - Constructs the debug code for exiting a declarative
/// region - "llvm.dbg.region.end."
- void EmitFunctionEnd(BasicBlock *CurBB, bool EndFunction);
+ void EmitFunctionEnd(bool EndFunction);
/// EmitDeclare - Constructs the debug code for allocation of a new variable.
/// region - "llvm.dbg.declare."
@@ -115,7 +115,7 @@
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
/// source line.
- void EmitStopPoint(Function *Fn, BasicBlock *CurBB, LLVMBuilder &Builder);
+ void EmitStopPoint(BasicBlock *CurBB, LLVMBuilder &Builder);
/// EmitGlobalVariable - Emit information about a global variable.
///
More information about the llvm-commits
mailing list