eliminate FileModel::Model, just use CodeGenFileType. The client
of the code generator shouldn't care what object format a target
uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95124 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 395eaa2..0927e1c 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -85,14 +85,14 @@
cl::value_desc("a1,+a2,-a3,..."));
cl::opt<TargetMachine::CodeGenFileType>
-FileType("filetype", cl::init(TargetMachine::AssemblyFile),
+FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile),
cl::desc("Choose a file type (not all types are supported by all targets):"),
cl::values(
- clEnumValN(TargetMachine::AssemblyFile, "asm",
+ clEnumValN(TargetMachine::CGFT_AssemblyFile, "asm",
"Emit an assembly ('.s') file"),
- clEnumValN(TargetMachine::ObjectFile, "obj",
+ clEnumValN(TargetMachine::CGFT_ObjectFile, "obj",
"Emit a native object ('.o') file [experimental]"),
- clEnumValN(TargetMachine::DynamicLibrary, "dynlib",
+ clEnumValN(TargetMachine::CGFT_DynamicLibrary, "dynlib",
"Emit a native dynamic library ('.so') file"
" [experimental]"),
clEnumValEnd));
@@ -162,7 +162,8 @@
bool Binary = false;
switch (FileType) {
- case TargetMachine::AssemblyFile:
+ default: assert(0 && "Unknown file type");
+ case TargetMachine::CGFT_AssemblyFile:
if (TargetName[0] == 'c') {
if (TargetName[1] == 0)
OutputFilename += ".cbe.c";
@@ -173,11 +174,11 @@
} else
OutputFilename += ".s";
break;
- case TargetMachine::ObjectFile:
+ case TargetMachine::CGFT_ObjectFile:
OutputFilename += ".o";
Binary = true;
break;
- case TargetMachine::DynamicLibrary:
+ case TargetMachine::CGFT_DynamicLibrary:
OutputFilename += LTDL_SHLIB_EXT;
Binary = true;
break;
@@ -352,14 +353,14 @@
default:
assert(0 && "Invalid file model!");
return 1;
- case FileModel::Error:
+ case TargetMachine::CGFT_ErrorOccurred:
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 FileModel::AsmFile:
+ case TargetMachine::CGFT_AssemblyFile:
break;
}
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 5275cc3..bb31b0b 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -396,9 +396,9 @@
codeGenPasses->add(new TargetData(*_target->getTargetData()));
switch (_target->addPassesToEmitFile(*codeGenPasses, out,
- TargetMachine::AssemblyFile,
+ TargetMachine::CGFT_AssemblyFile,
CodeGenOpt::Aggressive)) {
- case FileModel::AsmFile:
+ case TargetMachine::CGFT_AssemblyFile:
break;
default:
errMsg = "target file type not supported";