diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-08 02:36:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-08 02:36:43 +0000 |
commit | fce555a9817f893e6d22a987fbffc1a762c5ae8f (patch) | |
tree | 78d15556c0561ca5d91bdd2985300039ae93086a /llvm/lib/Transforms/IPO/InlineSimple.cpp | |
parent | d9bd5a0443f273b8316cddb154177970ebf97c12 (diff) | |
download | bcm5719-llvm-fce555a9817f893e6d22a987fbffc1a762c5ae8f.tar.gz bcm5719-llvm-fce555a9817f893e6d22a987fbffc1a762c5ae8f.zip |
Don't inline functions that take variable numbers of arguments!
llvm-svn: 6024
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index 5175bfd2c3a..a45c4546f82 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp @@ -20,7 +20,7 @@ #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" #include "llvm/iOther.h" -#include "llvm/Type.h" +#include "llvm/DerivedTypes.h" #include "Support/Statistic.h" #include <algorithm> @@ -42,8 +42,9 @@ bool InlineFunction(CallInst *CI) { assert(CI->getParent()->getParent() && "Instruction not in function!"); const Function *CalledFunc = CI->getCalledFunction(); - if (CalledFunc == 0 || // Can't inline external function or indirect call! - CalledFunc->isExternal()) return false; + if (CalledFunc == 0 || // Can't inline external function or indirect + CalledFunc->isExternal() || // call, or call to a vararg function! + CalledFunc->getFunctionType()->isVarArg()) return false; //std::cerr << "Inlining " << CalledFunc->getName() << " into " // << CurrentMeth->getName() << "\n"; |