summaryrefslogtreecommitdiff
path: root/tools/llc
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-25 05:22:29 +0000
committerChris Lattner <sabre@nondot.org>2003-04-25 05:22:29 +0000
commit2b5f2c1a648895d4075f0f35c8a37bd485b9eab0 (patch)
treee81743373cd44284c346ffbff8c37188a147e8c9 /tools/llc
parentd5bc41a2497b8ccfc21fe4de9f48e3db3a21895c (diff)
downloadllvm-2b5f2c1a648895d4075f0f35c8a37bd485b9eab0.tar.gz
llvm-2b5f2c1a648895d4075f0f35c8a37bd485b9eab0.tar.bz2
llvm-2b5f2c1a648895d4075f0f35c8a37bd485b9eab0.tar.xz
Make sure to add a targetdata instance to the passmanager, and make it match the
one in use by the TargetMachine git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index fe1b89ff2d..29daef7551 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -173,6 +173,7 @@ main(int argc, char **argv)
assert(target.get() && "Could not allocate target machine!");
TargetMachine &Target = *target.get();
+ const TargetData &TD = Target.getTargetData();
// Load the module to be compiled...
std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
@@ -185,6 +186,10 @@ main(int argc, char **argv)
// Build up all of the passes that we want to do to the module...
PassManager Passes;
+ Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getSubWordDataSize(),
+ TD.getIntegerRegSize(), TD.getPointerSize(),
+ TD.getPointerAlignment()));
+
// Create a new optimization pass for each one specified on the command line
// Deal specially with tracing passes, which must be run differently than opt.
//