[llvm-commits] [dragonegg] r114824 - in /dragonegg/trunk: llvm-abi-default.cpp llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp x86/llvm-target.cpp

Duncan Sands baldrick at free.fr
Mon Sep 27 06:16:29 PDT 2010


Author: baldrick
Date: Mon Sep 27 08:16:29 2010
New Revision: 114824

URL: http://llvm.org/viewvc/llvm-project?rev=114824&view=rev
Log:
Silence some unused parameter warnings.  Most of the parameters cannot be
removed because the function needs to conform to an externally defined
interface which specifies them.

Modified:
    dragonegg/trunk/llvm-abi-default.cpp
    dragonegg/trunk/llvm-backend.cpp
    dragonegg/trunk/llvm-convert.cpp
    dragonegg/trunk/llvm-internal.h
    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=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi-default.cpp (original)
+++ dragonegg/trunk/llvm-abi-default.cpp Mon Sep 27 08:16:29 2010
@@ -17,7 +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) {
+bool doNotUseShadowReturn(tree type, tree fndecl,
+                          CallingConv::ID CC ATTRIBUTE_UNUSED) {
   if (!TYPE_SIZE(type))
     return false;
   if (TREE_CODE(TYPE_SIZE(type)) != INTEGER_CST)

Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Mon Sep 27 08:16:29 2010
@@ -1554,7 +1554,8 @@
 /// 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, void *user_data) {
+static void llvm_start_unit(void *gcc_data ATTRIBUTE_UNUSED,
+                            void *user_data ATTRIBUTE_UNUSED) {
   if (!quiet_flag)
     errs() << "Starting compilation unit\n";
 
@@ -1868,7 +1869,7 @@
 
 /// 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) {
+                                 struct cgraph_node *target ATTRIBUTE_UNUSED) {
   if (errorcount || sorrycount)
     return; // Do not process broken code.
 
@@ -1962,7 +1963,7 @@
 };
 
 /// emit_variables - Output GCC global variables to the LLVM IR.
-static void emit_variables(cgraph_node_set set
+static void emit_variables(cgraph_node_set set ATTRIBUTE_UNUSED
 #if (GCC_MINOR > 5)
                            , varpool_node_set vset ATTRIBUTE_UNUSED
 #endif
@@ -2096,13 +2097,15 @@
 
 
 /// llvm_finish - Run shutdown code when GCC exits.
-static void llvm_finish(void *gcc_data, void *user_data) {
+static void llvm_finish(void *gcc_data ATTRIBUTE_UNUSED,
+                        void *user_data ATTRIBUTE_UNUSED) {
   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, void *user_data) {
+static void llvm_finish_unit(void *gcc_data ATTRIBUTE_UNUSED,
+                             void *user_data ATTRIBUTE_UNUSED) {
   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=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Mon Sep 27 08:16:29 2010
@@ -375,7 +375,7 @@
     /// getCallingConv - This provides the desired CallingConv for the function.
     CallingConv::ID& getCallingConv(void) { return CallingConv; }
 
-    void HandlePad(const llvm::Type *LLVMTy) {
+    void HandlePad(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED) {
       ++AI;
     }
 
@@ -394,8 +394,9 @@
       LocStack.clear();
     }
 
-    void HandleAggregateShadowResult(const PointerType *PtrArgTy,
-                                       bool RetPtr) {
+    void HandleAggregateShadowResult(
+      const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
+      bool RetPtr ATTRIBUTE_UNUSED) {
       // 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.
@@ -429,7 +430,8 @@
       ++AI;
     }
 
-    void HandleScalarShadowResult(const PointerType *PtrArgTy, bool RetPtr) {
+    void HandleScalarShadowResult(const PointerType *PtrArgTy ATTRIBUTE_UNUSED,
+                                  bool RetPtr ATTRIBUTE_UNUSED) {
       assert(AI != Builder.GetInsertBlock()->getParent()->arg_end() &&
              "No explicit return value?");
       AI->setName("scalar.result");
@@ -438,7 +440,8 @@
       ++AI;
     }
 
-    void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
+    void HandleScalarArgument(const llvm::Type *LLVMTy,
+                              tree type ATTRIBUTE_UNUSED,
                               unsigned RealSize = 0) {
       Value *ArgVal = AI;
       if (ArgVal->getType() != LLVMTy) {
@@ -467,11 +470,12 @@
       ++AI;
     }
 
-    void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
+    void HandleByValArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
+                             tree type ATTRIBUTE_UNUSED) {
       ++AI;
     }
 
-    void HandleFCAArgument(const llvm::Type *LLVMTy,
+    void HandleFCAArgument(const llvm::Type *LLVMTy ATTRIBUTE_UNUSED,
                            tree type ATTRIBUTE_UNUSED) {
       // Store the FCA argument into alloca.
       assert(!LocStack.empty());
@@ -481,7 +485,8 @@
       ++AI;
     }
 
-    void HandleAggregateResultAsScalar(const Type *ScalarTy, unsigned Offset=0){
+    void HandleAggregateResultAsScalar(const Type *ScalarTy ATTRIBUTE_UNUSED,
+                                       unsigned Offset=0) {
       this->Offset = Offset;
     }
 
@@ -506,7 +511,8 @@
 // passed in memory byval.
 static bool isPassedByVal(tree type, const Type *Ty,
                           std::vector<const Type*> &ScalarArgs,
-                          bool isShadowRet, CallingConv::ID &CC) {
+                          bool isShadowRet,
+                          CallingConv::ID &CC ATTRIBUTE_UNUSED) {
   if (LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(type, Ty))
     return true;
 
@@ -742,7 +748,7 @@
       // Emit gcroot intrinsic if arg has attribute
       if (POINTER_TYPE_P(TREE_TYPE(Args))
           && lookup_attribute ("gcroot", TYPE_ATTRIBUTES(TREE_TYPE(Args))))
-        EmitTypeGcroot(Tmp, Args);
+        EmitTypeGcroot(Tmp);
 
       Client.setName(Name);
       Client.setLocation(Tmp);
@@ -1433,7 +1439,7 @@
 /// CopyAggregate - Recursively traverse the potientially aggregate src/dest
 /// ptrs, copying all of the elements.
 static void CopyAggregate(MemRef DestLoc, MemRef SrcLoc,
-                          LLVMBuilder &Builder, tree gccType){
+                          LLVMBuilder &Builder, tree gccType) {
   assert(DestLoc.Ptr->getType() == SrcLoc.Ptr->getType() &&
          "Cannot copy between two pointers of different type!");
   const Type *ElTy =
@@ -1661,7 +1667,7 @@
 
 
 // Emits code to do something for a type attribute
-void TreeToLLVM::EmitTypeGcroot(Value *V, tree decl) {
+void TreeToLLVM::EmitTypeGcroot(Value *V) {
   // GC intrinsics can only be used in functions which specify a collector.
   Fn->setGC("shadow-stack");
 
@@ -1806,7 +1812,7 @@
       // We should null out local variables so that a stack crawl
       // before initialization doesn't get garbage results to follow.
       const Type *T = cast<PointerType>(AI->getType())->getElementType();
-      EmitTypeGcroot(AI, decl);
+      EmitTypeGcroot(AI);
       Builder.CreateStore(Constant::getNullValue(T), AI);
     }
 
@@ -2566,7 +2572,7 @@
 
     /// HandleScalarResult - This callback is invoked if the function returns a
     /// simple scalar result value.
-    void HandleScalarResult(const Type *RetTy) {
+    void HandleScalarResult(const Type *RetTy ATTRIBUTE_UNUSED) {
       // There is nothing to do here if we return a scalar or void.
       assert(DestLoc == 0 &&
              "Call returns a scalar but caller expects aggregate!");
@@ -2575,14 +2581,14 @@
     /// 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,
+    void HandleAggregateResultAsScalar(const Type *ScalarTy ATTRIBUTE_UNUSED,
                                        unsigned Offset = 0) {
       this->Offset = Offset;
     }
 
     /// HandleAggregateResultAsAggregate - This callback is invoked if the
     /// function returns an aggregate value using multiple return values.
-    void HandleAggregateResultAsAggregate(const Type *AggrTy) {
+    void HandleAggregateResultAsAggregate(const Type *AggrTy ATTRIBUTE_UNUSED) {
       // There is nothing to do here.
       isAggrRet = true;
     }
@@ -2592,7 +2598,7 @@
     /// RetPtr is set to true, the pointer argument itself is returned from the
     /// function.
     void HandleAggregateShadowResult(const PointerType *PtrArgTy,
-                                       bool RetPtr) {
+                                     bool RetPtr ATTRIBUTE_UNUSED) {
       // We need to pass memory to write the return value into.
       // FIXME: alignment and volatility are being ignored!
       assert(!DestLoc || PtrArgTy == DestLoc->Ptr->getType());
@@ -2625,7 +2631,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) {
+    void HandleScalarShadowResult(const PointerType *PtrArgTy,
+                                  bool RetPtr ATTRIBUTE_UNUSED) {
       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
@@ -2664,7 +2671,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){
+    void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy,
+                                            tree type ATTRIBUTE_UNUSED) {
       Value *Loc = getAddress();
       Loc = Builder.CreateBitCast(Loc, PtrTy);
       CallOperands.push_back(Loc);
@@ -2673,7 +2681,8 @@
     /// 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) {
+    void HandleByValArgument(const llvm::Type *LLVMTy,
+                             tree type ATTRIBUTE_UNUSED) {
       Value *Loc = getAddress();
       assert(LLVMTy->getPointerTo() == Loc->getType());
       CallOperands.push_back(Loc);

Modified: dragonegg/trunk/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-internal.h?rev=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/llvm-internal.h (original)
+++ dragonegg/trunk/llvm-internal.h Mon Sep 27 08:16:29 2010
@@ -584,7 +584,7 @@
   void EmitAnnotateIntrinsic(Value *V, tree_node *decl);
 
   /// EmitTypeGcroot - Emits call to make type a gcroot
-  void EmitTypeGcroot(Value *V, tree_node *decl);
+  void EmitTypeGcroot(Value *V);
 
 private:
 

Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Mon Sep 27 08:16:29 2010
@@ -1027,7 +1027,7 @@
     }
 
     void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
-                              unsigned RealSize = 0) {
+                              unsigned RealSize ATTRIBUTE_UNUSED = 0) {
       if (KNRPromotion) {
         if (type == float_type_node)
           LLVMTy = ConvertType(double_type_node);
@@ -1040,7 +1040,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) {
+    void HandleByInvisibleReferenceArgument(const llvm::Type *PtrTy,
+                                            tree type ATTRIBUTE_UNUSED) {
       ArgTypes.push_back(PtrTy);
     }
 
@@ -1460,7 +1461,8 @@
   /// 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,
+  bool ResizeLastElementIfOverlapsWith(uint64_t ByteOffset,
+                                       tree Field ATTRIBUTE_UNUSED,
                                        const Type *Ty) {
     const Type *SavedTy = NULL;
 

Modified: dragonegg/trunk/x86/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.cpp?rev=114824&r1=114823&r2=114824&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.cpp (original)
+++ dragonegg/trunk/x86/llvm-target.cpp Mon Sep 27 08:16:29 2010
@@ -88,7 +88,7 @@
  */
 bool TreeToLLVM::TargetIntrinsicLower(gimple stmt,
                                       tree fndecl,
-                                      const MemRef *DestLoc,
+                                      const MemRef *DestLoc ATTRIBUTE_UNUSED,
                                       Value *&Result,
                                       const Type *ResultType,
                                       std::vector<Value*> &Ops) {
@@ -1325,8 +1325,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,
-                                            std::vector<const Type*> &Elts){
+llvm_x86_64_get_multiple_return_reg_classes(tree TreeType,
+                                            const Type *Ty ATTRIBUTE_UNUSED,
+                                            std::vector<const Type*> &Elts) {
   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