[llvm-commits] [gcc-plugin] r81149 - /gcc-plugin/trunk/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Mon Sep 7 05:23:50 PDT 2009


Author: baldrick
Date: Mon Sep  7 07:23:50 2009
New Revision: 81149

URL: http://llvm.org/viewvc/llvm-project?rev=81149&view=rev
Log:
Name the ssa variable after the parameter name.
This makes the IR a lot more readable.

Modified:
    gcc-plugin/trunk/llvm-convert.cpp

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

==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Mon Sep  7 07:23:50 2009
@@ -2267,12 +2267,15 @@
   unsigned Alignment = DECL_ALIGN(var);
   assert(Alignment != 0 && "Parameter with unknown alignment!");
 
+  const char *ParameterName =
+    DECL_NAME(var) ? IDENTIFIER_POINTER(DECL_NAME(var)) : "anon";
+
   const Type *Ty = ConvertType(TREE_TYPE(exp));
   Value *Ptr = BitCastToType(DECL_LLVM_IF_SET(var), PointerType::getUnqual(Ty));
 
   // Perform the load in the entry block, after all parameters have been set up
   // with their initial values, and before any modifications to their values.
-  LoadInst *LI = new LoadInst(Ptr, "defaultdef", SSAInsertionPoint);
+  LoadInst *LI = new LoadInst(Ptr, ParameterName, SSAInsertionPoint);
   LI->setAlignment(Alignment);
   return SSANames[exp] = LI;
 }





More information about the llvm-commits mailing list