[llvm-commits] [dragonegg] r149690 - /dragonegg/trunk/src/Convert.cpp
Duncan Sands
baldrick at free.fr
Fri Feb 3 04:53:40 PST 2012
Author: baldrick
Date: Fri Feb 3 06:53:39 2012
New Revision: 149690
URL: http://llvm.org/viewvc/llvm-project?rev=149690&view=rev
Log:
Due to the new type system (in particular the self-recursive type loop breaking
logic), on 32 bit systems it is possible and normal to get here with mismatched
pointer types.
Modified:
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=149690&r1=149689&r2=149690&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Fri Feb 3 06:53:39 2012
@@ -2626,9 +2626,13 @@
if (CallOperands.size() < FTy->getNumParams()) {
Type *CalledTy= FTy->getParamType(CallOperands.size());
if (Loc->getType() != CalledTy) {
- assert(type && "Inconsistent parameter types?");
- bool isSigned = !TYPE_UNSIGNED(type);
- Loc = TheTreeToLLVM->CastToAnyType(Loc, isSigned, CalledTy, false);
+ if (type) {
+ bool isSigned = !TYPE_UNSIGNED(type);
+ Loc = TheTreeToLLVM->CastToAnyType(Loc, isSigned, CalledTy, false);
+ } else {
+ // Only trivial type conversions should get here.
+ Loc = Builder.CreateBitCast(Loc, CalledTy);
+ }
}
}
More information about the llvm-commits
mailing list