[llvm-commits] [dragonegg] r90321 - /dragonegg/trunk/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Wed Dec 2 08:24:26 PST 2009
Author: baldrick
Date: Wed Dec 2 10:24:25 2009
New Revision: 90321
URL: http://llvm.org/viewvc/llvm-project?rev=90321&view=rev
Log:
In C++ code, the target of a call may be an OBJ_TYPE_REF. Ignore these.
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=90321&r1=90320&r2=90321&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Wed Dec 2 10:24:25 2009
@@ -2224,11 +2224,10 @@
/// EmitRegister - Convert the specified gimple register or local constant of
/// register type to an LLVM value. Only creates code in the entry block.
Value *TreeToLLVM::EmitRegister(tree reg) {
+ while (TREE_CODE(reg) == OBJ_TYPE_REF) reg = OBJ_TYPE_REF_EXPR(reg);
Value *V = (TREE_CODE(reg) == SSA_NAME) ?
EmitSSA_NAME(reg) : EmitMinInvariant(reg);
- assert(V->getType() == ConvertType(TREE_TYPE(reg)) &&
- "Gimple register has wrong type!");
- return V;
+ return Builder.CreateBitCast(V, ConvertType(TREE_TYPE(reg)));
}
/// EmitLoadOfLValue - When an l-value expression is used in a context that
More information about the llvm-commits
mailing list