diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-03 05:55:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-03 05:55:08 +0000 |
commit | 5669e3009761dff20b67e18a382c334041887928 (patch) | |
tree | 1627a6f9aa094e2aba6b96e3e258b7e47de42a14 /tools | |
parent | febc81680c80a53f15f85b1812cba07fc179b9fd (diff) | |
download | external_llvm-5669e3009761dff20b67e18a382c334041887928.zip external_llvm-5669e3009761dff20b67e18a382c334041887928.tar.gz external_llvm-5669e3009761dff20b67e18a382c334041887928.tar.bz2 |
change addPassesToEmitFile to return true on failure instead of its input,
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llc/llc.cpp | 18 | ||||
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 13 |
2 files changed, 10 insertions, 21 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index c7bd1c6..fe34bd1 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -91,9 +91,8 @@ FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), "Emit an assembly ('.s') file"), clEnumValN(TargetMachine::CGFT_ObjectFile, "obj", "Emit a native object ('.o') file [experimental]"), - clEnumValN(TargetMachine::CGFT_DynamicLibrary, "dynlib", - "Emit a native dynamic library ('.so') file" - " [experimental]"), + clEnumValN(TargetMachine::CGFT_Null, "null", + "Emit nothing, for performance testing"), clEnumValEnd)); cl::opt<bool> NoVerify("disable-verify", cl::Hidden, @@ -177,8 +176,8 @@ static formatted_raw_ostream *GetOutputStream(const char *TargetName, OutputFilename += ".o"; Binary = true; break; - case TargetMachine::CGFT_DynamicLibrary: - OutputFilename += LTDL_SHLIB_EXT; + case TargetMachine::CGFT_Null: + OutputFilename += ".null"; Binary = true; break; } @@ -348,20 +347,13 @@ int main(int argc, char **argv) { // Override default to generate verbose assembly. Target.setAsmVerbosityDefault(true); - switch (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl)) { - default: - assert(0 && "Invalid file model!"); - return 1; - case TargetMachine::CGFT_ErrorOccurred: + if (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl)) { errs() << argv[0] << ": target does not support generation of this" << " file type!\n"; if (Out != &fouts()) delete Out; // And the Out file is empty and useless, so remove it now. sys::Path(OutputFilename).eraseFromDisk(); return 1; - case TargetMachine::CGFT_AssemblyFile: - case TargetMachine::CGFT_ObjectFile: - break; } Passes.doInitialization(); diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 7e873ab..0a58aa7 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -393,14 +393,11 @@ bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out, codeGenPasses->add(new TargetData(*_target->getTargetData())); - switch (_target->addPassesToEmitFile(*codeGenPasses, out, - TargetMachine::CGFT_AssemblyFile, - CodeGenOpt::Aggressive)) { - case TargetMachine::CGFT_AssemblyFile: - break; - default: - errMsg = "target file type not supported"; - return true; + if (_target->addPassesToEmitFile(*codeGenPasses, out, + TargetMachine::CGFT_AssemblyFile, + CodeGenOpt::Aggressive)) { + errMsg = "target file type not supported"; + return true; } // Run our queue of passes all at once now, efficiently. |