[llvm-commits] [dragonegg] r137589 - in /dragonegg/trunk: include/dragonegg/Internals.h src/Backend.cpp src/Types.cpp
Duncan Sands
baldrick at free.fr
Sun Aug 14 11:37:02 PDT 2011
Author: baldrick
Date: Sun Aug 14 13:37:02 2011
New Revision: 137589
URL: http://llvm.org/viewvc/llvm-project?rev=137589&view=rev
Log:
Move two methods to a different file. Drop the !HAS_RTL_P check since
this cache is no longer shared with other logic, so there is no risk of
overlap.
Modified:
dragonegg/trunk/include/dragonegg/Internals.h
dragonegg/trunk/src/Backend.cpp
dragonegg/trunk/src/Types.cpp
Modified: dragonegg/trunk/include/dragonegg/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Internals.h?rev=137589&r1=137588&r2=137589&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Internals.h (original)
+++ dragonegg/trunk/include/dragonegg/Internals.h Sun Aug 14 13:37:02 2011
@@ -159,14 +159,6 @@
// Mapping between GCC declarations and non-negative integers. The GCC
// declaration must not satisfy HAS_RTL_P.
-/// set_decl_index - Associate a non-negative number with the given GCC
-/// declaration.
-int set_decl_index(tree_node *, int);
-
-/// get_decl_index - Get the non-negative number associated with the given GCC
-/// declaration. Returns a negative value if no such association has been made.
-int get_decl_index(tree_node *);
-
void changeLLVMConstant(Constant *Old, Constant *New);
void register_ctor_dtor(Function *, int, bool);
const char *extractRegisterName(tree_node *);
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=137589&r1=137588&r2=137589&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Sun Aug 14 13:37:02 2011
@@ -146,25 +146,6 @@
return V ? V->stripPointerCasts() : 0;
}
-/// set_decl_index - Associate a non-negative number with the given GCC
-/// declaration.
-int set_decl_index(tree t, int i) {
- assert(!HAS_RTL_P(t) && "Expected a declaration without RTL!");
- assert(i >= 0 && "Negative indices not allowed!");
- setCachedInteger(t, i);
- return i;
-}
-
-/// get_decl_index - Get the non-negative number associated with the given GCC
-/// declaration. Returns a negative value if no such association has been made.
-int get_decl_index(tree t) {
- assert(!HAS_RTL_P(t) && "Expected a declaration without RTL!");
- int Idx;
- if (getCachedInteger(t, Idx))
- return Idx;
- return -1;
-}
-
/// changeLLVMConstant - Replace Old with New everywhere, updating all maps
/// (except for AttributeAnnotateGlobals, which is a different kind of animal).
/// At this point we know that New is not in any of these maps.
Modified: dragonegg/trunk/src/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Types.cpp?rev=137589&r1=137588&r2=137589&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Sun Aug 14 13:37:02 2011
@@ -217,6 +217,23 @@
return Range < 0 ? 0 : 1 + (uint64_t)Range;
}
+/// set_decl_index - Associate a non-negative number with the given GCC
+/// field declaration.
+static int set_decl_index(tree t, int i) {
+ assert(i >= 0 && "Negative indices not allowed!");
+ setCachedInteger(t, i);
+ return i;
+}
+
+/// get_decl_index - Get the non-negative number associated with the given GCC
+/// field decl. Returns a negative value if no such association has been made.
+static int get_decl_index(tree t) {
+ int Idx;
+ if (getCachedInteger(t, Idx))
+ return Idx;
+ return -1;
+}
+
/// GetFieldIndex - Return the index of the field in the given LLVM type that
/// corresponds to the GCC field declaration 'decl'. This means that the LLVM
/// and GCC fields start in the same byte (if 'decl' is a bitfield, this means
More information about the llvm-commits
mailing list