aboutsummaryrefslogtreecommitdiffstats
path: root/tools/extract
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-28 22:22:16 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-28 22:22:16 +0000
commit204089042be123e007398a8d246d20c6ce3d7272 (patch)
tree7c880b35044a64d5ea43239a2d870bc68a84efab /tools/extract
parentad910ebe70644040701f8f39fd96eed78ca2ed23 (diff)
downloadexternal_llvm-204089042be123e007398a8d246d20c6ce3d7272.zip
external_llvm-204089042be123e007398a8d246d20c6ce3d7272.tar.gz
external_llvm-204089042be123e007398a8d246d20c6ce3d7272.tar.bz2
Fix extract to use the right TargetData, like Bugpoint does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/extract')
-rw-r--r--tools/extract/extract.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/extract/extract.cpp b/tools/extract/extract.cpp
index c4dbe08..272d473 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 <memory>
@@ -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