diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 91c8caf50c1..7262739e926 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -47,7 +47,7 @@ JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji) // Add target data MutexGuard locked(lock); FunctionPassManager& PM = state.getPM(locked); - PM.add(new TargetData(TM.getTargetData())); + PM.add(new TargetData(*TM.getTargetData())); // Compile LLVM Code down to machine code in the intermediate representation TJI.addPassesToJITCompile(PM); diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 4d36e837e8d..1df22ac0c79 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -143,11 +143,10 @@ int main(int argc, char **argv) { std::auto_ptr target(MArch->CtorFn(mod, FeaturesStr)); assert(target.get() && "Could not allocate target machine!"); TargetMachine &Target = *target.get(); - const TargetData *TD = Target.getTargetData(); // Build up all of the passes that we want to do to the module... PassManager Passes; - Passes.add(new TargetData(TD)); + Passes.add(new TargetData(*Target.getTargetData())); #ifndef NDEBUG if(!NoVerify)