Skip to content

Instantly share code, notes, and snippets.

@tomprince
Created December 5, 2010 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomprince/729415 to your computer and use it in GitHub Desktop.
Save tomprince/729415 to your computer and use it in GitHub Desktop.
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index d53f329..1f17d5a 100644
--- a/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -965,11 +965,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
const Type *OldRetTy = Caller->getType();
const Type *NewRetTy = FT->getReturnType();
- if (NewRetTy->isStructTy())
- return false; // TODO: Handle multiple return values.
-
// Check to see if we are changing the return type...
if (OldRetTy != NewRetTy) {
+ if (NewRetTy->isStructTy())
+ return false; // TODO: Handle multiple return values.
+
if (Callee->isDeclaration() &&
// Conversion is ok if changing from one pointer type to another or from
// a pointer to an integer of the same size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment