[llvm-commits] [dragonegg] r150392 - in /dragonegg/trunk/src: Backend.cpp Constants.cpp Convert.cpp Debug.cpp Types.cpp x86/Target.cpp

Duncan Sands baldrick at free.fr
Mon Feb 13 07:23:00 PST 2012


Author: baldrick
Date: Mon Feb 13 09:23:00 2012
New Revision: 150392

URL: http://llvm.org/viewvc/llvm-project?rev=150392&view=rev
Log:
Fix up some cases where a variable was shadowing another one.

Modified:
    dragonegg/trunk/src/Backend.cpp
    dragonegg/trunk/src/Constants.cpp
    dragonegg/trunk/src/Convert.cpp
    dragonegg/trunk/src/Debug.cpp
    dragonegg/trunk/src/Types.cpp
    dragonegg/trunk/src/x86/Target.cpp

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon Feb 13 09:23:00 2012
@@ -1839,7 +1839,6 @@
   // Run the code generator, if present.
   if (CodeGenPasses) {
     // Arrange for inline asm problems to be printed nicely.
-    LLVMContext &Context = TheModule->getContext();
     LLVMContext::InlineAsmDiagHandlerTy OldHandler =
       Context.getInlineAsmDiagnosticHandler();
     void *OldHandlerData = Context.getInlineAsmDiagnosticContext();
@@ -2032,12 +2031,11 @@
 };
 
 #ifndef DISABLE_VERSION_CHECK
-static bool version_check(struct plugin_gcc_version *gcc_version,
-                          struct plugin_gcc_version *plugin_version) {
+static bool version_check(struct plugin_gcc_version *plugged_in_version) {
   // Check that the running gcc has exactly the same version as the gcc we were
   // built against.  This strict check seems wise when developing against a fast
   // moving gcc tree.  TODO: Use a milder check if doing a "release build".
-  return plugin_default_version_check (gcc_version, plugin_version);
+  return plugin_default_version_check (&gcc_version, plugged_in_version);
 }
 #endif
 
@@ -2057,7 +2055,7 @@
 
 #ifndef DISABLE_VERSION_CHECK
   // Check that the plugin is compatible with the running gcc.
-  if (!version_check (&gcc_version, version)) {
+  if (!version_check (version)) {
     errs() << "Incompatible plugin version\n";
     return 1;
   }

Modified: dragonegg/trunk/src/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Constants.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/Constants.cpp (original)
+++ dragonegg/trunk/src/Constants.cpp Mon Feb 13 09:23:00 2012
@@ -864,11 +864,11 @@
       unsigned PadBits = EltSize - ValSize;
       assert(PadBits % BITS_PER_UNIT == 0 && "Non-unit type size?");
       unsigned Units = PadBits / BITS_PER_UNIT;
-      Constant *Elts[] = {
+      Constant *PaddedElt[] = {
         Val, UndefValue::get(GetUnitType(Context, Units))
       };
 
-      Val = ConstantStruct::getAnon(Elts);
+      Val = ConstantStruct::getAnon(PaddedElt);
     }
 
     // Get the index position of the element within the array.  Note that this

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Mon Feb 13 09:23:00 2012
@@ -443,8 +443,8 @@
     }
 
     void HandleAggregateResultAsScalar(Type * /*ScalarTy*/,
-                                       unsigned Offset = 0) {
-      this->Offset = Offset;
+                                       unsigned Off = 0) {
+      this->Offset = Off;
     }
 
     void EnterField(unsigned FieldNo, llvm::Type *StructTy) {
@@ -766,9 +766,9 @@
   TreeVector IncomingValues;
   ValueVector PhiArguments;
 
-  for (unsigned i = 0, e = PendingPhis.size(); i < e; ++i) {
+  for (unsigned Idx = 0, EIdx = PendingPhis.size(); Idx < EIdx; ++Idx) {
     // The phi node to process.
-    PhiRecord &P = PendingPhis[i];
+    PhiRecord &P = PendingPhis[Idx];
 
     // Extract the incoming value for each predecessor from the GCC phi node.
     for (size_t i = 0, e = gimple_phi_num_args(P.gcc_phi); i != e; ++i) {
@@ -1771,7 +1771,6 @@
       // Assert its a string, and then get that string.
       assert(TREE_CODE(val) == STRING_CST &&
              "Annotate attribute arg should always be a string");
-      Type *SBP = Type::getInt8PtrTy(Context);
       Constant *strGV = AddressOf(val);
       Value *Ops[4] = {
         Builder.CreateBitCast(V, SBP),
@@ -2522,16 +2521,16 @@
 
     // EmitShadowResult - If the return result was redirected to a buffer,
     // emit it now.
-    Value *EmitShadowResult(tree type, const MemRef *DestLoc) {
+    Value *EmitShadowResult(tree type, const MemRef *DstLoc) {
       if (!RetBuf.Ptr)
         return 0;
 
-      if (DestLoc) {
+      if (DstLoc) {
         // Copy out the aggregate return value now.
         assert(ConvertType(type) ==
                cast<PointerType>(RetBuf.Ptr->getType())->getElementType() &&
                "Inconsistent result types!");
-        TheTreeToLLVM->EmitAggregateCopy(*DestLoc, RetBuf, type);
+        TheTreeToLLVM->EmitAggregateCopy(*DstLoc, RetBuf, type);
         return 0;
       } else {
         // Read out the scalar return value now.
@@ -2551,8 +2550,8 @@
     /// returns an aggregate value by bit converting it to the specified scalar
     /// type and returning that.
     void HandleAggregateResultAsScalar(Type * /*ScalarTy*/,
-                                       unsigned Offset = 0) {
-      this->Offset = Offset;
+                                       unsigned Off = 0) {
+      this->Offset = Off;
     }
 
     /// HandleAggregateResultAsAggregate - This callback is invoked if the
@@ -2797,8 +2796,8 @@
     if (Attrs != Attribute::None) {
       // If the argument is split into multiple scalars, assign the
       // attributes to all scalars of the aggregate.
-      for (unsigned i = OldSize + 1; i <= CallOperands.size(); ++i) {
-        PAL = PAL.addAttr(i, Attrs);
+      for (unsigned j = OldSize + 1; j <= CallOperands.size(); ++j) {
+        PAL = PAL.addAttr(j, Attrs);
       }
     }
 
@@ -5171,7 +5170,7 @@
 
   Type *SBP = Type::getInt8PtrTy(Context);
 
-  Function *Fn = Intrinsic::getDeclaration(TheModule,
+  Function *An = Intrinsic::getDeclaration(TheModule,
                                            Intrinsic::ptr_annotation,
                                            SBP);
 
@@ -5216,7 +5215,7 @@
       };
 
       Type* FieldPtrType = FieldPtr->getType();
-      FieldPtr = Builder.CreateCall(Fn, Ops);
+      FieldPtr = Builder.CreateCall(An, Ops);
       FieldPtr = Builder.CreateBitCast(FieldPtr, FieldPtrType);
     }
 

Modified: dragonegg/trunk/src/Debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Debug.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/Debug.cpp (original)
+++ dragonegg/trunk/src/Debug.cpp Mon Feb 13 09:23:00 2012
@@ -740,10 +740,12 @@
 
   // Check if this type is created while creating context information
   // descriptor.
-  std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(type);
-  if (I != TypeCache.end())
-    if (MDNode *TN = dyn_cast_or_null<MDNode>(&*I->second))
-      return DIType(TN);
+  {
+    std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(type);
+    if (I != TypeCache.end())
+      if (MDNode *TN = dyn_cast_or_null<MDNode>(&*I->second))
+        return DIType(TN);
+  }
 
   // forward declaration,
   if (TYPE_SIZE(type) == 0) {
@@ -932,10 +934,10 @@
 
   DIType Ty;
   if (tree TyDef = TYPE_NAME(type)) {
-      std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(TyDef);
-      if (I != TypeCache.end())
-        if (Value *M = I->second)
-          return DIType(cast<MDNode>(M));
+    std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(TyDef);
+    if (I != TypeCache.end())
+      if (I->second)
+        return DIType(cast<MDNode>(I->second));
     if (TREE_CODE(TyDef) == TYPE_DECL &&  DECL_ORIGINAL_TYPE(TyDef)) {
       expanded_location TypeDefLoc = GetNodeLocation(TyDef);
       Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef,
@@ -1002,8 +1004,8 @@
   // Check to see if the compile unit already has created this type.
   std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(type);
   if (I != TypeCache.end())
-    if (Value *M = I->second)
-      return DIType(cast<MDNode>(M));
+    if (I->second)
+      return DIType(cast<MDNode>(I->second));
 
   DIType MainTy;
   if (type != TYPE_MAIN_VARIANT(type) && TYPE_MAIN_VARIANT(type))

Modified: dragonegg/trunk/src/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Types.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Mon Feb 13 09:23:00 2012
@@ -542,16 +542,16 @@
 
     /// HandleScalarResult - This callback is invoked if the function returns a
     /// simple scalar result value.
-    void HandleScalarResult(Type *RetTy) {
-      this->RetTy = RetTy;
+    void HandleScalarResult(Type *RTy) {
+      this->RetTy = RTy;
     }
 
     /// 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(Type *ScalarTy, unsigned Offset=0) {
+    void HandleAggregateResultAsScalar(Type *ScalarTy, unsigned Off=0) {
       RetTy = ScalarTy;
-      this->Offset = Offset;
+      this->Offset = Off;
     }
 
     /// HandleAggregateResultAsAggregate - This callback is invoked if the function

Modified: dragonegg/trunk/src/x86/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/Target.cpp?rev=150392&r1=150391&r2=150392&view=diff
==============================================================================
--- dragonegg/trunk/src/x86/Target.cpp (original)
+++ dragonegg/trunk/src/x86/Target.cpp Mon Feb 13 09:23:00 2012
@@ -1130,12 +1130,12 @@
           llvm_unreachable("Not yet handled!");
       } else if ((NumClasses-i) == 2) {
         if (Class[i+1] == X86_64_SSEUP_CLASS) {
-          Type *Ty = ConvertType(TreeType);
-          if (StructType *STy = dyn_cast<StructType>(Ty))
+          Type *LLVMTy = ConvertType(TreeType);
+          if (StructType *STy = dyn_cast<StructType>(LLVMTy))
             // Look pass the struct wrapper.
             if (STy->getNumElements() == 1)
-              Ty = STy->getElementType(0);
-          if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {
+              LLVMTy = STy->getElementType(0);
+          if (VectorType *VTy = dyn_cast<VectorType>(LLVMTy)) {
             if (VTy->getNumElements() == 2) {
               if (VTy->getElementType()->isIntegerTy()) {
                 Elts.push_back(VectorType::get(Type::getInt64Ty(Context), 2));
@@ -1152,7 +1152,7 @@
               }
               Bytes -= 4;
             }
-          } else if (llvm_x86_is_all_integer_types(Ty)) {
+          } else if (llvm_x86_is_all_integer_types(LLVMTy)) {
             Elts.push_back(VectorType::get(Type::getInt32Ty(Context), 4));
             Bytes -= 4;
           } else {





More information about the llvm-commits mailing list