summaryrefslogtreecommitdiff
path: root/tools/llvm-extract
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-06 21:30:04 +0000
committerChris Lattner <sabre@nondot.org>2002-10-06 21:30:04 +0000
commit7d3f8671c15901df8417acc20c01ca82ff8cc180 (patch)
tree14eb0f89c32873e560dae4e1a4bc7b03fd6f0442 /tools/llvm-extract
parentf6ffcb6b713c259992b68d6b328f1b806775b9fb (diff)
downloadllvm-7d3f8671c15901df8417acc20c01ca82ff8cc180.tar.gz
llvm-7d3f8671c15901df8417acc20c01ca82ff8cc180.tar.bz2
llvm-7d3f8671c15901df8417acc20c01ca82ff8cc180.tar.xz
- The extract tool now is sure to extract the function implementation for
the specified name instead of extracting the prototype if both exist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-extract')
-rw-r--r--tools/llvm-extract/llvm-extract.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index e904beac80..b16b4f609e 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -38,7 +38,13 @@ struct FunctionExtractorPass : public Pass {
// functions that are not the named function.
for (Module::iterator I = M.begin(), E = M.end(); I != E;)
// Check to see if this is the named function!
- if (!Named && I->getName() == ExtractFunc) {
+ if (I->getName() == ExtractFunc && !I->isExternal()) {
+ if (Named) { // Two functions, same name?
+ std::cerr << "extract ERROR: Two functions named: '" << ExtractFunc
+ << "' found!\n";
+ exit(1);
+ }
+
// Yes, it is. Keep track of it...
Named = I;