mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix PR2231 - opt -internalize -std-compile-opts should run internalize first
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9322fe02dd
commit
3dda08ad5d
@ -379,18 +379,21 @@ int main(int argc, char **argv) {
|
|||||||
// Add an appropriate TargetData instance for this module...
|
// Add an appropriate TargetData instance for this module...
|
||||||
Passes.add(new TargetData(M.get()));
|
Passes.add(new TargetData(M.get()));
|
||||||
|
|
||||||
// If -std-compile-opts is given, add in all the standard compilation
|
// If the -strip-debug command line option was specified, add it. If
|
||||||
// optimizations first. This will handle -strip-debug, -disable-inline,
|
// -std-compile-opts was also specified, it will handle StripDebug.
|
||||||
// and -disable-opt as well.
|
if (StripDebug && !StandardCompileOpts)
|
||||||
if (StandardCompileOpts)
|
|
||||||
AddStandardCompilePasses(Passes);
|
|
||||||
|
|
||||||
// otherwise if the -strip-debug command line option was specified, add it.
|
|
||||||
else if (StripDebug)
|
|
||||||
addPass(Passes, createStripSymbolsPass(true));
|
addPass(Passes, createStripSymbolsPass(true));
|
||||||
|
|
||||||
// Create a new optimization pass for each one specified on the command line
|
// Create a new optimization pass for each one specified on the command line
|
||||||
for (unsigned i = 0; i < PassList.size(); ++i) {
|
for (unsigned i = 0; i < PassList.size(); ++i) {
|
||||||
|
// Check to see if -std-compile-opts we specified before this option. If
|
||||||
|
// so, handle it.
|
||||||
|
if (StandardCompileOpts &&
|
||||||
|
StandardCompileOpts.getPosition() < PassList.getPosition(i)) {
|
||||||
|
AddStandardCompilePasses(Passes);
|
||||||
|
StandardCompileOpts = false;
|
||||||
|
}
|
||||||
|
|
||||||
const PassInfo *PassInf = PassList[i];
|
const PassInfo *PassInf = PassList[i];
|
||||||
Pass *P = 0;
|
Pass *P = 0;
|
||||||
if (PassInf->getNormalCtor())
|
if (PassInf->getNormalCtor())
|
||||||
@ -419,6 +422,12 @@ int main(int argc, char **argv) {
|
|||||||
Passes.add(new PrintModulePass(&cerr));
|
Passes.add(new PrintModulePass(&cerr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If -std-compile-opts was specified at the end of the pass list, add them.
|
||||||
|
if (StandardCompileOpts) {
|
||||||
|
AddStandardCompilePasses(Passes);
|
||||||
|
StandardCompileOpts = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check that the module is well formed on completion of optimization
|
// Check that the module is well formed on completion of optimization
|
||||||
if (!NoVerify && !VerifyEach)
|
if (!NoVerify && !VerifyEach)
|
||||||
Passes.add(createVerifierPass());
|
Passes.add(createVerifierPass());
|
||||||
|
Loading…
Reference in New Issue
Block a user