[llvm-commits] [dragonegg] r90228 - /dragonegg/trunk/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Tue Dec 1 04:33:40 PST 2009
Author: baldrick
Date: Tue Dec 1 06:33:40 2009
New Revision: 90228
URL: http://llvm.org/viewvc/llvm-project?rev=90228&view=rev
Log:
Collapse a bunch of cases that are all handled by EmitGimpleReg.
Output more information in EmitGimpleConstant if it sees an
unexpected tree, since this is where you now end up if Emit is
called with a tree we don't know about.
Modified:
dragonegg/trunk/llvm-convert.cpp
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=90228&r1=90227&r2=90228&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Tue Dec 1 06:33:40 2009
@@ -1172,9 +1172,7 @@
Value *Result = 0;
switch (TREE_CODE(exp)) {
- default:
- debug_tree(exp);
- llvm_unreachable("Unhandled expression!");
+ default: Result = EmitGimpleReg(exp); break;
// Exception handling.
//FIXME case EXC_PTR_EXPR: Result = EmitEXC_PTR_EXPR(exp); break;
@@ -1210,21 +1208,6 @@
// Exceptional (tcc_exceptional).
case CONSTRUCTOR: Result = EmitCONSTRUCTOR(exp, DestLoc); break;
- case SSA_NAME: Result = EmitSSA_NAME(exp); break;
-
- // Constants (tcc_constant).
- case COMPLEX_CST:
- Result = TreeConstantToLLVM::ConvertCOMPLEX_CST(exp);
- break;
- case INTEGER_CST:
- Result = TreeConstantToLLVM::ConvertINTEGER_CST(exp);
- break;
- case REAL_CST:
- Result = TreeConstantToLLVM::ConvertREAL_CST(exp);
- break;
- case VECTOR_CST:
- Result = TreeConstantToLLVM::ConvertVECTOR_CST(exp);
- break;
}
assert(((DestLoc && Result == 0) || DestLoc == 0) &&
@@ -2238,7 +2221,12 @@
/// EmitGimpleConstant - Return the LLVM constant for this global constant.
Constant *TreeToLLVM::EmitGimpleConstant(tree reg) {
- assert(is_gimple_constant(reg) && "Not a gimple constant!");
+#ifndef NDEBUG
+ if (!is_gimple_constant(reg)) {
+ debug_tree(reg);
+ llvm_unreachable("Not a gimple constant!");
+ }
+#endif
assert(is_gimple_reg_type(TREE_TYPE(reg)) && "Not of register type!");
Constant *C;
More information about the llvm-commits
mailing list