diff --git a/tools/extract/extract.cpp b/tools/extract/extract.cpp index c4dbe08716b..272d4731808 100644 --- a/tools/extract/extract.cpp +++ b/tools/extract/extract.cpp @@ -17,6 +17,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/WriteBytecodePass.h" #include "llvm/Transforms/IPO.h" +#include "llvm/Target/TargetData.h" #include "Support/CommandLine.h" #include @@ -52,6 +53,7 @@ int main(int argc, char **argv) { // a little bit. Do this now. // PassManager Passes; + Passes.add(new TargetData("extract", M.get())); // Use correct TargetData Passes.add(createFunctionExtractionPass(F)); // Extract the function Passes.add(createGlobalDCEPass()); // Delete unreachable globals Passes.add(createFunctionResolvingPass()); // Delete prototypes diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp index c4dbe08716b..272d4731808 100644 --- a/tools/llvm-extract/llvm-extract.cpp +++ b/tools/llvm-extract/llvm-extract.cpp @@ -17,6 +17,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/WriteBytecodePass.h" #include "llvm/Transforms/IPO.h" +#include "llvm/Target/TargetData.h" #include "Support/CommandLine.h" #include @@ -52,6 +53,7 @@ int main(int argc, char **argv) { // a little bit. Do this now. // PassManager Passes; + Passes.add(new TargetData("extract", M.get())); // Use correct TargetData Passes.add(createFunctionExtractionPass(F)); // Extract the function Passes.add(createGlobalDCEPass()); // Delete unreachable globals Passes.add(createFunctionResolvingPass()); // Delete prototypes