[llvm-commits] [dragonegg] r127831 - /dragonegg/trunk/Constants.cpp

Duncan Sands baldrick at free.fr
Thu Mar 17 14:31:12 PDT 2011


Author: baldrick
Date: Thu Mar 17 16:31:12 2011
New Revision: 127831

URL: http://llvm.org/viewvc/llvm-project?rev=127831&view=rev
Log:
Reorder some methods, no functionality change.

Modified:
    dragonegg/trunk/Constants.cpp

Modified: dragonegg/trunk/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Constants.cpp?rev=127831&r1=127830&r2=127831&view=diff
==============================================================================
--- dragonegg/trunk/Constants.cpp (original)
+++ dragonegg/trunk/Constants.cpp Thu Mar 17 16:31:12 2011
@@ -1334,29 +1334,6 @@
   return Slot;
 }
 
-/// AddressOfDecl - Return the address of a global.
-static Constant *AddressOfDecl(tree exp) {
-  return cast<GlobalValue>(DEFINITION_LLVM(exp));
-}
-
-/// AddressOfLABEL_DECL - Return the address of a label.
-static Constant *AddressOfLABEL_DECL(tree exp) {
-  extern TreeToLLVM *TheTreeToLLVM;
-
-  assert(TheTreeToLLVM &&
-         "taking the address of a label while not compiling the function!");
-
-  // Figure out which function this is for, verify it's the one we're compiling.
-  if (DECL_CONTEXT(exp)) {
-    assert(TREE_CODE(DECL_CONTEXT(exp)) == FUNCTION_DECL &&
-           "Address of label in nested function?");
-    assert(TheTreeToLLVM->getFUNCTION_DECL() == DECL_CONTEXT(exp) &&
-           "Taking the address of a label that isn't in the current fn!?");
-  }
-
-  return TheTreeToLLVM->AddressOfLABEL_DECL(exp);
-}
-
 /// AddressOfARRAY_REF - Return the address of an array element or slice.
 static Constant *AddressOfARRAY_REF(tree exp) {
   tree array = TREE_OPERAND(exp, 0);
@@ -1439,6 +1416,29 @@
   return FieldPtr;
 }
 
+/// AddressOfDecl - Return the address of a global.
+static Constant *AddressOfDecl(tree exp) {
+  return cast<GlobalValue>(DEFINITION_LLVM(exp));
+}
+
+/// AddressOfLABEL_DECL - Return the address of a label.
+static Constant *AddressOfLABEL_DECL(tree exp) {
+  extern TreeToLLVM *TheTreeToLLVM;
+
+  assert(TheTreeToLLVM &&
+         "taking the address of a label while not compiling the function!");
+
+  // Figure out which function this is for, verify it's the one we're compiling.
+  if (DECL_CONTEXT(exp)) {
+    assert(TREE_CODE(DECL_CONTEXT(exp)) == FUNCTION_DECL &&
+           "Address of label in nested function?");
+    assert(TheTreeToLLVM->getFUNCTION_DECL() == DECL_CONTEXT(exp) &&
+           "Taking the address of a label that isn't in the current fn!?");
+  }
+
+  return TheTreeToLLVM->AddressOfLABEL_DECL(exp);
+}
+
 Constant *AddressOf(tree exp) {
   Constant *LV;
 





More information about the llvm-commits mailing list