[llvm-commits] [gcc-plugin] r80081 - in /gcc-plugin/trunk: i386/llvm-target.cpp llvm-backend.cpp llvm-convert.cpp llvm-debug.cpp llvm-types.cpp

Duncan Sands baldrick at free.fr
Wed Aug 26 04:33:23 PDT 2009


Author: baldrick
Date: Wed Aug 26 06:33:23 2009
New Revision: 80081

URL: http://llvm.org/viewvc/llvm-project?rev=80081&view=rev
Log:
Remove a bunch of unused variables.

Modified:
    gcc-plugin/trunk/i386/llvm-target.cpp
    gcc-plugin/trunk/llvm-backend.cpp
    gcc-plugin/trunk/llvm-convert.cpp
    gcc-plugin/trunk/llvm-debug.cpp
    gcc-plugin/trunk/llvm-types.cpp

Modified: gcc-plugin/trunk/i386/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/i386/llvm-target.cpp?rev=80081&r1=80080&r2=80081&view=diff

==============================================================================
--- gcc-plugin/trunk/i386/llvm-target.cpp (original)
+++ gcc-plugin/trunk/i386/llvm-target.cpp Wed Aug 26 06:33:23 2009
@@ -1318,7 +1318,6 @@
     return NULL;
 
   const StructType *STy = cast<StructType>(Ty);
-  unsigned NumElements = STy->getNumElements();
   std::vector<const Type *> ElementTypes;
 
   // Special handling for _Complex.
@@ -1418,7 +1417,7 @@
     } 
 
     // Special treatement for _Complex.
-    if (const StructType *ComplexType = dyn_cast<StructType>(DestElemType)) {
+    if (isa<StructType>(DestElemType)) {
       llvm::Value *Idxs[3];
       Idxs[0] = ConstantInt::get(llvm::Type::getInt32Ty(Context), 0);
       Idxs[1] = ConstantInt::get(llvm::Type::getInt32Ty(Context), DNO);

Modified: gcc-plugin/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=80081&r1=80080&r2=80081&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-backend.cpp (original)
+++ gcc-plugin/trunk/llvm-backend.cpp Wed Aug 26 06:33:23 2009
@@ -1119,8 +1119,6 @@
     TREE_ASM_WRITTEN(decl) = 1;
     return;  // Do not process broken code.
   }
-  
-  LLVMContext &Context = getGlobalContext();
 
 //TODO  timevar_push(TV_LLVM_GLOBALS);
 
@@ -1318,8 +1316,6 @@
   // been set.  Don't crash.
   // We can also get here when DECL_LLVM has not been set for some object
   // referenced in the initializer.  Don't crash then either.
-  LLVMContext &Context = getGlobalContext();
-  
   if (errorcount || sorrycount)
     return;
 
@@ -1385,8 +1381,6 @@
   if (!TYPE_SIZE(TREE_TYPE(decl)))
     return;
 
-  LLVMContext &Context = getGlobalContext();
-
 //TODO  timevar_push(TV_LLVM_GLOBALS);
 
   // Get or create the global variable now.
@@ -1547,7 +1541,6 @@
 /// well-formed.  If not, emit error messages and return true.  If so, return
 /// false.
 bool ValidateRegisterVariable(tree decl) {
-  LLVMContext &Context = getGlobalContext();
   int RegNumber = decode_reg_name(extractRegisterName(decl));
   const Type *Ty = ConvertType(TREE_TYPE(decl));
 

Modified: gcc-plugin/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=80081&r1=80080&r2=80081&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Wed Aug 26 06:33:23 2009
@@ -2197,9 +2197,9 @@
   if (UnwindBB) {
     CreateExceptionValues();
     EmitBlock(UnwindBB);
-    // Fetch and store exception handler.
-    Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr");
 abort();//FIXME
+//FIXME    // Fetch and store exception handler.
+//FIXME    Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr");
 //FIXME    assert(llvm_unwind_resume_libfunc && "no unwind resume function!");
 //FIXME
 //FIXME    // As we're emitting a naked call (not an expression) going through
@@ -3495,8 +3495,6 @@
 Value *TreeToLLVM::EmitTruthOp(tree exp, unsigned Opc) {
   Value *LHS = Emit(TREE_OPERAND(exp, 0), 0);
   Value *RHS = Emit(TREE_OPERAND(exp, 1), 0);
-  bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
-  bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1)));
 
   // This is a truth operation like the strict &&,||,^^.  Convert to bool as
   // a test against zero
@@ -4391,7 +4389,6 @@
   for (tree Output = ASM_OUTPUTS(exp); Output;
        Output = TREE_CHAIN(Output), ++ValNum) {
     tree Operand = TREE_VALUE(Output);
-    tree type = TREE_TYPE(Operand);
 
     // Parse the output constraint.
     const char *Constraint = Constraints[ValNum];
@@ -6132,21 +6129,16 @@
     return true;
   }
 
-  tree last_parm = tree_last(DECL_ARGUMENTS(current_function_decl));
   tree chain = TREE_CHAIN(arglist);
 
   // Check for errors.
   if (fold_builtin_next_arg (chain, true))
     return true;
 
-  tree arg = TREE_VALUE(chain);
-
   Value *ArgVal = Emit(TREE_VALUE(arglist), 0);
 
   Constant *llvm_va_start_fn = Intrinsic::getDeclaration(TheModule,
                                                          Intrinsic::vastart);
-  const Type *FTy =
-    cast<PointerType>(llvm_va_start_fn->getType())->getElementType();
   ArgVal = BitCastToType(ArgVal, PointerType::getUnqual(Type::getInt8Ty(Context)));
   Builder.CreateCall(llvm_va_start_fn, ArgVal);
   return true;
@@ -6391,7 +6383,6 @@
 Value *TreeToLLVM::EmitFieldAnnotation(Value *FieldPtr, tree FieldDecl) {
   tree AnnotateAttr = lookup_attribute("annotate", DECL_ATTRIBUTES(FieldDecl));
 
-  const Type *OrigPtrTy = FieldPtr->getType();
   const Type *SBP = PointerType::getUnqual(Type::getInt8Ty(Context));
 
   Function *Fn = Intrinsic::getDeclaration(TheModule,
@@ -6775,6 +6766,7 @@
         && (TREE_STATIC(exp) || DECL_EXTERNAL(exp))) {
       layout_decl(exp, 0);
 
+#if 0
       // This mirrors code in layout_decl for munging the RTL.  Here we actually
       // emit a NEW declaration for the global variable, now that it has been
       // laid out.  We then tell the compiler to "forward" any uses of the old
@@ -6782,13 +6774,12 @@
       if (Value *Val = DECL_LLVM_IF_SET(exp)) {
         //fprintf(stderr, "***\n*** SHOULD HANDLE GLOBAL VARIABLES!\n***\n");
         //assert(0 && "Reimplement this with replace all uses!");
-#if 0
         SET_DECL_LLVM(exp, 0);
         // Create a new global variable declaration
         llvm_assemble_external(exp);
         V2GV(Val)->ForwardedGlobal = V2GV(DECL_LLVM(exp));
-#endif
       }
+#endif
     }
   }
 
@@ -6887,7 +6878,7 @@
   } else {
     // If the input is a scalar, emit to a temporary.
     Value *Dest = CreateTemporary(ConvertType(TREE_TYPE(Op)));
-    StoreInst *S = Builder.CreateStore(Emit(Op, 0), Dest);
+    Builder.CreateStore(Emit(Op, 0), Dest);
     // The type is the type of the expression.
     Dest = BitCastToType(Dest,
                      PointerType::getUnqual(ConvertType(TREE_TYPE(exp))));
@@ -8061,7 +8052,6 @@
   // BitStart - This is the actual offset of the field from the start of the
   // struct, in bits.  For bitfields this may be on a non-byte boundary.
   unsigned BitStart = getComponentRefOffsetInBits(exp);
-  unsigned BitSize  = 0;
   Constant *FieldPtr;
   const TargetData &TD = getTargetData();
 

Modified: gcc-plugin/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-debug.cpp?rev=80081&r1=80080&r2=80081&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-debug.cpp (original)
+++ gcc-plugin/trunk/llvm-debug.cpp Wed Aug 26 06:33:23 2009
@@ -611,8 +611,6 @@
   llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
   
   if (tree binfo = TYPE_BINFO(type)) {
-    VEC (tree, gc) *accesses = BINFO_BASE_ACCESSES (binfo);
-    
     for (unsigned i = 0, e = BINFO_N_BASE_BINFOS(binfo); i != e; ++i) {
       tree BInfo = BINFO_BASE_BINFO(binfo, i);
       tree BInfoType = BINFO_TYPE (BInfo);

Modified: gcc-plugin/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-types.cpp?rev=80081&r1=80080&r2=80081&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-types.cpp (original)
+++ gcc-plugin/trunk/llvm-types.cpp Wed Aug 26 06:33:23 2009
@@ -569,7 +569,6 @@
   case ARRAY_TYPE: {
     unsigned EltSizeBits = TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(type)));
     unsigned NumElts = cast<ArrayType>(ConvertType(type))->getNumElements();
-    unsigned OverlapElt = (unsigned)PadStartBits/EltSizeBits;
 
     // Check each element for overlap.  This is inelegant, but effective.
     for (unsigned i = 0; i != NumElts; ++i)





More information about the llvm-commits mailing list