Make sure to add a targetdata instance to the passmanager, and make it match the
authorChris Lattner <sabre@nondot.org>
Fri, 25 Apr 2003 05:22:29 +0000 (05:22 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 25 Apr 2003 05:22:29 +0000 (05:22 +0000)
one in use by the TargetMachine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5931 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index fe1b89ff2d34ea80bcd1a3ba6a04dcf2eb340155..29daef755157eba700ac60c286fb295405aef4e1 100644 (file)
@@ -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.
   //