[llvm-commits] CVS: llvm/tools/extract/extract.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 6 16:31:01 PDT 2002


Changes in directory llvm/tools/extract:

extract.cpp updated: 1.9 -> 1.10

---
Log message:

  - The extract tool now is sure to extract the function implementation for 
    the specified name instead of extracting the prototype if both exist.


---
Diffs of the changes:

Index: llvm/tools/extract/extract.cpp
diff -u llvm/tools/extract/extract.cpp:1.9 llvm/tools/extract/extract.cpp:1.10
--- llvm/tools/extract/extract.cpp:1.9	Tue Jul 30 16:43:15 2002
+++ llvm/tools/extract/extract.cpp	Sun Oct  6 16:30:04 2002
@@ -38,7 +38,13 @@
     // 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;
 





More information about the llvm-commits mailing list