[llvm-commits] [dragonegg] r129512 - in /dragonegg/trunk/src: Convert.cpp Types.cpp
Duncan Sands
baldrick at free.fr
Thu Apr 14 03:49:13 PDT 2011
Author: baldrick
Date: Thu Apr 14 05:49:12 2011
New Revision: 129512
URL: http://llvm.org/viewvc/llvm-project?rev=129512&view=rev
Log:
Move getRegType into Types.cpp.
Modified:
dragonegg/trunk/src/Convert.cpp
dragonegg/trunk/src/Types.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=129512&r1=129511&r2=129512&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Thu Apr 14 05:49:12 2011
@@ -6143,22 +6143,6 @@
// ... EmitReg* - Convert register expression to LLVM...
//===----------------------------------------------------------------------===//
-/// getRegType - Returns the LLVM type to use for registers that hold a value
-/// of the scalar GCC type 'type'. All of the EmitReg* routines use this to
-/// determine the LLVM type to return.
-const Type *TreeToLLVM::getRegType(tree type) {
- assert(!AGGREGATE_TYPE_P(type) && "Registers must have a scalar type!");
- assert(TREE_CODE(type) != VOID_TYPE && "Registers cannot have void type!");
-
- // For integral types, convert based on the type precision.
- if (TREE_CODE(type) == BOOLEAN_TYPE || TREE_CODE(type) == ENUMERAL_TYPE ||
- TREE_CODE(type) == INTEGER_TYPE)
- return IntegerType::get(Context, TYPE_PRECISION(type));
-
- // Otherwise, return the type used to represent memory.
- return ConvertType(type);
-}
-
/// EmitMemory - Convert the specified gimple register or local constant of
/// register type to an LLVM value with in-memory type (given by ConvertType).
Value *TreeToLLVM::EmitMemory(tree reg) {
Modified: dragonegg/trunk/src/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Types.cpp?rev=129512&r1=129511&r2=129512&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Thu Apr 14 05:49:12 2011
@@ -648,6 +648,23 @@
// Main Type Conversion Routines
//===----------------------------------------------------------------------===//
+/// getRegType - Returns the LLVM type to use for registers that hold a value
+/// of the scalar GCC type 'type'. All of the EmitReg* routines use this to
+/// determine the LLVM type to return.
+const Type *TreeToLLVM::getRegType(tree type) {
+ assert(!AGGREGATE_TYPE_P(type) && "Registers must have a scalar type!");
+ assert(TREE_CODE(type) != VOID_TYPE && "Registers cannot have void type!");
+
+ // For integral types, convert based on the type precision.
+ if (TREE_CODE(type) == BOOLEAN_TYPE || TREE_CODE(type) == ENUMERAL_TYPE ||
+ TREE_CODE(type) == INTEGER_TYPE)
+ return IntegerType::get(Context, TYPE_PRECISION(type));
+
+ // Otherwise, return the type used to represent memory.
+ return ConvertType(type);
+}
+
+
const Type *TypeConverter::ConvertType(tree type) {
if (type == error_mark_node) return Type::getInt32Ty(Context);
More information about the llvm-commits
mailing list