aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-extract
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-05 21:17:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-05 21:17:53 +0000
commitcdedc3b336ff7552e439723fdb96dda68b1dbbdb (patch)
treebad14dffc775e5f25d5f5be324c73b53d69787bd /tools/llvm-extract
parent60ea274c706b6be9fb587d5f7c69405bef468b8c (diff)
downloadexternal_llvm-cdedc3b336ff7552e439723fdb96dda68b1dbbdb.zip
external_llvm-cdedc3b336ff7552e439723fdb96dda68b1dbbdb.tar.gz
external_llvm-cdedc3b336ff7552e439723fdb96dda68b1dbbdb.tar.bz2
For PR411:
Change getNamedFunction -> getFunction Make llvm-extract run the StripDeadPrototypes pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-extract')
-rw-r--r--tools/llvm-extract/llvm-extract.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index 932f19e..b26fd9c 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -64,7 +64,7 @@ int main(int argc, char **argv) {
}
// Figure out which function we should extract
- Function *F = M.get()->getNamedFunction(ExtractFunc);
+ Function *F = M.get()->getFunction(ExtractFunc);
if (F == 0) {
cerr << argv[0] << ": program doesn't contain function named '"
<< ExtractFunc << "'!\n";
@@ -80,6 +80,7 @@ int main(int argc, char **argv) {
if (!DeleteFn)
Passes.add(createGlobalDCEPass()); // Delete unreachable globals
Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
+ Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls
std::ostream *Out = 0;