[llvm-commits] CVS: llvm/tools/jello/jello.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Dec 2 15:23:01 PST 2002
Changes in directory llvm/tools/jello:
jello.cpp updated: 1.4 -> 1.5
---
Log message:
Add initial support for machine code emission
---
Diffs of the changes:
Index: llvm/tools/jello/jello.cpp
diff -u llvm/tools/jello/jello.cpp:1.4 llvm/tools/jello/jello.cpp:1.5
--- llvm/tools/jello/jello.cpp:1.4 Tue Oct 29 20:18:29 2002
+++ llvm/tools/jello/jello.cpp Mon Dec 2 15:22:04 2002
@@ -16,6 +16,15 @@
#include "Support/CommandLine.h"
#include "Support/Statistic.h"
+
+#include "llvm/CodeGen/MachineCodeEmitter.h"
+
+struct JelloMachineCodeEmitter : public MachineCodeEmitter {
+
+
+};
+
+
namespace {
cl::opt<std::string>
InputFile(cl::desc("<input bytecode>"), cl::Positional, cl::init("-"));
@@ -48,9 +57,21 @@
}
PassManager Passes;
+
+ // Compile LLVM Code down to machine code in the intermediate representation
if (Target.addPassesToJITCompile(Passes)) {
std::cerr << argv[0] << ": target '" << Target.getName()
<< "' doesn't support JIT compilation!\n";
+ return 1;
+ }
+
+ // Turn the machine code intermediate representation into bytes in memory that
+ // may be executed.
+ //
+ JelloMachineCodeEmitter MCE;
+ if (Target.addPassesToEmitMachineCode(Passes, MCE)) {
+ std::cerr << argv[0] << ": target '" << Target.getName()
+ << "' doesn't support machine code emission!\n";
return 1;
}
More information about the llvm-commits
mailing list