[llvm-commits] [dragonegg] r127467 - in /dragonegg/trunk: Backend.cpp Constants.cpp Constants.h Convert.cpp Internals.h

Duncan Sands baldrick at free.fr
Fri Mar 11 08:49:37 PST 2011


Author: baldrick
Date: Fri Mar 11 10:49:37 2011
New Revision: 127467

URL: http://llvm.org/viewvc/llvm-project?rev=127467&view=rev
Log:
Rename EmitAddressOf to AddressOf.  No functionality change.

Modified:
    dragonegg/trunk/Backend.cpp
    dragonegg/trunk/Constants.cpp
    dragonegg/trunk/Constants.h
    dragonegg/trunk/Convert.cpp
    dragonegg/trunk/Internals.h

Modified: dragonegg/trunk/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Backend.cpp?rev=127467&r1=127466&r2=127467&view=diff
==============================================================================
--- dragonegg/trunk/Backend.cpp (original)
+++ dragonegg/trunk/Backend.cpp Fri Mar 11 10:49:37 2011
@@ -964,7 +964,7 @@
       // Assert its a string, and then get that string.
       assert(TREE_CODE(val) == STRING_CST &&
              "Annotate attribute arg should always be a string");
-      Constant *strGV = EmitAddressOf(val);
+      Constant *strGV = AddressOf(val);
       Constant *Element[4] = {
         TheFolder->CreateBitCast(GV,SBP),
         TheFolder->CreateBitCast(strGV,SBP),

Modified: dragonegg/trunk/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Constants.cpp?rev=127467&r1=127466&r2=127467&view=diff
==============================================================================
--- dragonegg/trunk/Constants.cpp (original)
+++ dragonegg/trunk/Constants.cpp Fri Mar 11 10:49:37 2011
@@ -956,7 +956,7 @@
   case VIEW_CONVERT_EXPR: return ConvertConstant(TREE_OPERAND(exp, 0));
   case POINTER_PLUS_EXPR: return ConvertPOINTER_PLUS_EXPR(exp);
   case ADDR_EXPR:
-    return TheFolder->CreateBitCast(EmitAddressOf(TREE_OPERAND(exp, 0)),
+    return TheFolder->CreateBitCast(AddressOf(TREE_OPERAND(exp, 0)),
                                     ConvertType(TREE_TYPE(exp)));
   }
 }
@@ -972,7 +972,7 @@
         return align;
 }
 
-static Constant *EmitAddressOfDecl(tree exp) {
+static Constant *AddressOfDecl(tree exp) {
   GlobalValue *Val = cast<GlobalValue>(DEFINITION_LLVM(exp));
 
   // The type of the global value output for exp need not match that of exp.
@@ -985,8 +985,8 @@
   return TheFolder->CreateBitCast(Val, Ty->getPointerTo());
 }
 
-/// EmitAddressOfLABEL_DECL - Someone took the address of a label.
-static Constant *EmitAddressOfLABEL_DECL(tree exp) {
+/// AddressOfLABEL_DECL - Someone took the address of a label.
+static Constant *AddressOfLABEL_DECL(tree exp) {
   extern TreeToLLVM *TheTreeToLLVM;
 
   assert(TheTreeToLLVM &&
@@ -1000,10 +1000,10 @@
            "Taking the address of a label that isn't in the current fn!?");
   }
 
-  return TheTreeToLLVM->EmitLV_LABEL_DECL(exp);
+  return TheTreeToLLVM->AddressOfLABEL_DECL(exp);
 }
 
-static Constant *EmitAddressOfCOMPLEX_CST(tree exp) {
+static Constant *AddressOfCOMPLEX_CST(tree exp) {
   Constant *Init = ConvertCOMPLEX_CST(exp);
 
   // Cache the constants to avoid making obvious duplicates that have to be
@@ -1020,7 +1020,7 @@
   return Slot;
 }
 
-static Constant *EmitAddressOfREAL_CST(tree exp) {
+static Constant *AddressOfREAL_CST(tree exp) {
   Constant *Init = ConvertREAL_CST(exp);
 
   // Cache the constants to avoid making obvious duplicates that have to be
@@ -1037,7 +1037,7 @@
   return Slot;
 }
 
-static Constant *EmitAddressOfSTRING_CST(tree exp) {
+static Constant *AddressOfSTRING_CST(tree exp) {
   Constant *Init = ConvertSTRING_CST(exp);
 
   GlobalVariable **SlotP = 0;
@@ -1059,7 +1059,7 @@
   return GV;
 }
 
-static Constant *EmitAddressOfARRAY_REF(tree exp) {
+static Constant *AddressOfARRAY_REF(tree exp) {
   tree Array = TREE_OPERAND(exp, 0);
   tree Index = TREE_OPERAND(exp, 1);
   tree IndexType = TREE_TYPE(Index);
@@ -1084,7 +1084,7 @@
 
   // Avoid any assumptions about how the array type is represented in LLVM by
   // doing the GEP on a pointer to the first array element.
-  Constant *ArrayAddr = EmitAddressOf(Array);
+  Constant *ArrayAddr = AddressOf(Array);
   const Type *EltTy = ConvertType(TREE_TYPE(TREE_TYPE(Array)));
   ArrayAddr = TheFolder->CreateBitCast(ArrayAddr, EltTy->getPointerTo());
 
@@ -1093,8 +1093,8 @@
     TheFolder->CreateGetElementPtr(ArrayAddr, &IndexVal, 1);
 }
 
-static Constant *EmitAddressOfCOMPONENT_REF(tree exp) {
-  Constant *StructAddrLV = EmitAddressOf(TREE_OPERAND(exp, 0));
+static Constant *AddressOfCOMPONENT_REF(tree exp) {
+  Constant *StructAddrLV = AddressOf(TREE_OPERAND(exp, 0));
 
   tree FieldDecl = TREE_OPERAND(exp, 1);
   const Type *StructTy = ConvertType(DECL_CONTEXT(FieldDecl));
@@ -1171,7 +1171,7 @@
   return FieldPtr;
 }
 
-Constant *EmitAddressOf(tree exp) {
+Constant *AddressOf(tree exp) {
   Constant *LV;
 
   switch (TREE_CODE(exp)) {
@@ -1182,26 +1182,26 @@
   case FUNCTION_DECL:
   case CONST_DECL:
   case VAR_DECL:
-    LV = EmitAddressOfDecl(exp);
+    LV = AddressOfDecl(exp);
     break;
   case LABEL_DECL:
-    LV = EmitAddressOfLABEL_DECL(exp);
+    LV = AddressOfLABEL_DECL(exp);
     break;
   case COMPLEX_CST:
-    LV = EmitAddressOfCOMPLEX_CST(exp);
+    LV = AddressOfCOMPLEX_CST(exp);
     break;
   case REAL_CST:
-    LV = EmitAddressOfREAL_CST(exp);
+    LV = AddressOfREAL_CST(exp);
     break;
   case STRING_CST:
-    LV = EmitAddressOfSTRING_CST(exp);
+    LV = AddressOfSTRING_CST(exp);
     break;
   case COMPONENT_REF:
-    LV = EmitAddressOfCOMPONENT_REF(exp);
+    LV = AddressOfCOMPONENT_REF(exp);
     break;
   case ARRAY_RANGE_REF:
   case ARRAY_REF:
-    LV = EmitAddressOfARRAY_REF(exp);
+    LV = AddressOfARRAY_REF(exp);
     break;
   case INDIRECT_REF:
     // The lvalue is just the address.
@@ -1209,12 +1209,12 @@
     break;
   case COMPOUND_LITERAL_EXPR: // FIXME: not gimple - defined by C front-end
     /* This used to read
-       return EmitAddressOf(COMPOUND_LITERAL_EXPR_DECL(exp));
+       return AddressOf(COMPOUND_LITERAL_EXPR_DECL(exp));
        but gcc warns about that and there doesn't seem to be any way to stop it
        with casts or the like.  The following is equivalent with no checking
        (since we know TREE_CODE(exp) is COMPOUND_LITERAL_EXPR the checking
        doesn't accomplish anything anyway). */
-    LV = EmitAddressOf(DECL_EXPR_DECL (TREE_OPERAND (exp, 0)));
+    LV = AddressOf(DECL_EXPR_DECL (TREE_OPERAND (exp, 0)));
     break;
   }
 

Modified: dragonegg/trunk/Constants.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Constants.h?rev=127467&r1=127466&r2=127467&view=diff
==============================================================================
--- dragonegg/trunk/Constants.h (original)
+++ dragonegg/trunk/Constants.h Fri Mar 11 10:49:37 2011
@@ -34,6 +34,6 @@
 extern llvm::Constant *ConvertConstant(tree_node *exp);
 
 // Constant Expression l-values.
-extern llvm::Constant *EmitAddressOf(tree_node *exp);
+extern llvm::Constant *AddressOf(tree_node *exp);
 
 #endif /* DRAGONEGG_CONSTANTS_H */

Modified: dragonegg/trunk/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Convert.cpp?rev=127467&r1=127466&r2=127467&view=diff
==============================================================================
--- dragonegg/trunk/Convert.cpp (original)
+++ dragonegg/trunk/Convert.cpp Fri Mar 11 10:49:37 2011
@@ -1282,13 +1282,13 @@
 
   // Constants.
   case LABEL_DECL: {
-    LV = LValue(EmitLV_LABEL_DECL(exp), 1);
+    LV = LValue(AddressOfLABEL_DECL(exp), 1);
     break;
   }
   case COMPLEX_CST:
   case REAL_CST:
   case STRING_CST: {
-    Value *Ptr = EmitAddressOf(exp);
+    Value *Ptr = AddressOf(exp);
     LV = LValue(Ptr, get_constant_alignment(exp) / 8);
     break;
   }
@@ -1724,7 +1724,7 @@
       assert(TREE_CODE(val) == STRING_CST &&
              "Annotate attribute arg should always be a string");
       const Type *SBP = Type::getInt8PtrTy(Context);
-      Constant *strGV = EmitAddressOf(val);
+      Constant *strGV = AddressOf(val);
       Value *Ops[4] = {
         Builder.CreateBitCast(V, SBP),
         Builder.CreateBitCast(strGV, SBP),
@@ -1842,7 +1842,7 @@
   STRIP_NOPS(type);
   if (TREE_CODE(type) == ADDR_EXPR)
     type = TREE_OPERAND(type, 0);
-  return EmitAddressOf(type);
+  return AddressOf(type);
 }
 
 /// getExceptionPtr - Return the local holding the exception pointer for the
@@ -5357,7 +5357,7 @@
       assert(TREE_CODE(val) == STRING_CST &&
              "Annotate attribute arg should always be a string");
 
-      Constant *strGV = EmitAddressOf(val);
+      Constant *strGV = AddressOf(val);
 
       // We can not use the IRBuilder because it will constant fold away
       // the GEP that is critical to distinguish between an annotate
@@ -5805,7 +5805,7 @@
   return Ref;
 }
 
-Constant *TreeToLLVM::EmitLV_LABEL_DECL(tree exp) {
+Constant *TreeToLLVM::AddressOfLABEL_DECL(tree exp) {
   return BlockAddress::get(Fn, getLabelDeclBlock(exp));
 }
 

Modified: dragonegg/trunk/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Internals.h?rev=127467&r1=127466&r2=127467&view=diff
==============================================================================
--- dragonegg/trunk/Internals.h (original)
+++ dragonegg/trunk/Internals.h Fri Mar 11 10:49:37 2011
@@ -854,7 +854,7 @@
 
 public:
   // Helper for taking the address of a label.
-  Constant *EmitLV_LABEL_DECL(tree_node *exp);
+  Constant *AddressOfLABEL_DECL(tree_node *exp);
 };
 
 #endif /* DRAGONEGG_INTERNALS_H */





More information about the llvm-commits mailing list