summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-06 05:09:34 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-06 05:09:34 +0000
commitac57e6e498abccb117e0d61c2fa0f733845e50cb (patch)
tree95b0b0f5302bb05adb156b329f422d1399de236e /tools
parent14ce9ef2e9013ba56e1daafebd91fe3ee1e8647e (diff)
downloadllvm-ac57e6e498abccb117e0d61c2fa0f733845e50cb.tar.gz
llvm-ac57e6e498abccb117e0d61c2fa0f733845e50cb.tar.bz2
llvm-ac57e6e498abccb117e0d61c2fa0f733845e50cb.tar.xz
Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llc/llc.cpp9
-rw-r--r--tools/lto/LTOCodeGenerator.cpp8
2 files changed, 9 insertions, 8 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index ae03c1e0c0..42d158cf5e 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -17,6 +17,7 @@
#include "llvm/CodeGen/FileWriters.h"
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
#include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
+#include "llvm/CodeGen/ObjectCodeEmitter.h"
#include "llvm/Target/SubtargetFeature.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
@@ -312,7 +313,7 @@ int main(int argc, char **argv) {
#endif
// Ask the target to add backend passes as necessary.
- MachineCodeEmitter *MCE = 0;
+ ObjectCodeEmitter *OCE = 0;
// Override default to generate verbose assembly.
Target.setAsmVerbosityDefault(true);
@@ -331,14 +332,14 @@ int main(int argc, char **argv) {
case FileModel::AsmFile:
break;
case FileModel::MachOFile:
- MCE = AddMachOWriter(Passes, *Out, Target);
+ OCE = AddMachOWriter(Passes, *Out, Target);
break;
case FileModel::ElfFile:
- MCE = AddELFWriter(Passes, *Out, Target);
+ OCE = AddELFWriter(Passes, *Out, Target);
break;
}
- if (Target.addPassesToEmitFileFinish(Passes, MCE, OLvl)) {
+ if (Target.addPassesToEmitFileFinish(Passes, OCE, OLvl)) {
std::cerr << argv[0] << ": target does not support generation of this"
<< " file type!\n";
if (Out != &outs()) delete Out;
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 1a21132ef2..801707f8d9 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -430,16 +430,16 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
codeGenPasses->add(new TargetData(*_target->getTargetData()));
- MachineCodeEmitter* mce = NULL;
+ ObjectCodeEmitter* oce = NULL;
switch (_target->addPassesToEmitFile(*codeGenPasses, out,
TargetMachine::AssemblyFile,
CodeGenOpt::Aggressive)) {
case FileModel::MachOFile:
- mce = AddMachOWriter(*codeGenPasses, out, *_target);
+ oce = AddMachOWriter(*codeGenPasses, out, *_target);
break;
case FileModel::ElfFile:
- mce = AddELFWriter(*codeGenPasses, out, *_target);
+ oce = AddELFWriter(*codeGenPasses, out, *_target);
break;
case FileModel::AsmFile:
break;
@@ -449,7 +449,7 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
return true;
}
- if (_target->addPassesToEmitFileFinish(*codeGenPasses, mce,
+ if (_target->addPassesToEmitFileFinish(*codeGenPasses, oce,
CodeGenOpt::Aggressive)) {
errMsg = "target does not support generation of this file type";
return true;