mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 09:13:34 +00:00
Fix a bug in the checkin where I adjusted this code to work when
LinkModules nukes the second module argument. llvm-svn: 17986
This commit is contained in:
parent
c385bbef7b
commit
b1263d42f8
@ -295,8 +295,9 @@ static bool ExtractLoops(BugDriver &BD,
|
|||||||
std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
|
std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
|
||||||
for (Module::iterator I = ToOptimizeLoopExtracted->begin(),
|
for (Module::iterator I = ToOptimizeLoopExtracted->begin(),
|
||||||
E = ToOptimizeLoopExtracted->end(); I != E; ++I)
|
E = ToOptimizeLoopExtracted->end(); I != E; ++I)
|
||||||
MisCompFunctions.push_back(std::make_pair(I->getName(),
|
if (!I->isExternal())
|
||||||
I->getFunctionType()));
|
MisCompFunctions.push_back(std::make_pair(I->getName(),
|
||||||
|
I->getFunctionType()));
|
||||||
|
|
||||||
// Okay, great! Now we know that we extracted a loop and that loop
|
// Okay, great! Now we know that we extracted a loop and that loop
|
||||||
// extraction both didn't break the program, and didn't mask the problem.
|
// extraction both didn't break the program, and didn't mask the problem.
|
||||||
@ -432,8 +433,9 @@ static bool ExtractBlocks(BugDriver &BD,
|
|||||||
std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
|
std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions;
|
||||||
for (Module::iterator I = Extracted->begin(), E = Extracted->end();
|
for (Module::iterator I = Extracted->begin(), E = Extracted->end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
MisCompFunctions.push_back(std::make_pair(I->getName(),
|
if (!I->isExternal())
|
||||||
I->getFunctionType()));
|
MisCompFunctions.push_back(std::make_pair(I->getName(),
|
||||||
|
I->getFunctionType()));
|
||||||
|
|
||||||
std::string ErrorMsg;
|
std::string ErrorMsg;
|
||||||
if (LinkModules(ProgClone, Extracted, &ErrorMsg)) {
|
if (LinkModules(ProgClone, Extracted, &ErrorMsg)) {
|
||||||
@ -624,11 +626,10 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
|
|||||||
|
|
||||||
// Call the old main function and return its result
|
// Call the old main function and return its result
|
||||||
BasicBlock *BB = new BasicBlock("entry", newMain);
|
BasicBlock *BB = new BasicBlock("entry", newMain);
|
||||||
CallInst *call = new CallInst(oldMainProto, args);
|
CallInst *call = new CallInst(oldMainProto, args, "", BB);
|
||||||
BB->getInstList().push_back(call);
|
|
||||||
|
|
||||||
// If the type of old function wasn't void, return value of call
|
// If the type of old function wasn't void, return value of call
|
||||||
new ReturnInst(oldMain->getReturnType() != Type::VoidTy ? call : 0, BB);
|
new ReturnInst(call, BB);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The second nasty issue we must deal with in the JIT is that the Safe
|
// The second nasty issue we must deal with in the JIT is that the Safe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user