[llvm-commits] CVS: reopt/lib/Mapping/getLLVMinfo.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Fri Aug 29 00:14:01 PDT 2003


Changes in directory reopt/lib/Mapping:

getLLVMinfo.cpp updated: 1.18 -> 1.19

---
Log message:

Don't fail an assert if we see a module with a function which isn't
 in the llvmSimpleFunction table; just be safe and return false.


---
Diffs of the changes:

Index: reopt/lib/Mapping/getLLVMinfo.cpp
diff -u reopt/lib/Mapping/getLLVMinfo.cpp:1.18 reopt/lib/Mapping/getLLVMinfo.cpp:1.19
--- reopt/lib/Mapping/getLLVMinfo.cpp:1.18	Fri Aug 22 12:43:41 2003
+++ reopt/lib/Mapping/getLLVMinfo.cpp	Fri Aug 29 00:12:48 2003
@@ -232,8 +232,15 @@
     int i = 0;
     for (Module::iterator FI = M->begin (), FE = M->end (); FE != FI; ++FI) {
       if (FI->isExternal ()) continue;
-      assert (i < llvmFunctionCount && "No such function in function table");
-      FunctionInlinable[FI] = llvmSimpleFunction[i];
+      if (i >= llvmFunctionCount) {
+	// This is a function that must not have been seen by the
+	// -emitfuncs pass, assuming that the functions in M haven't
+	// been reordered since -emitfuncs saw them. Assume it's not
+	// inlinable (instead of failing an assert as before.)
+	FunctionInlinable[FI] = false;
+      } else {
+	FunctionInlinable[FI] = llvmSimpleFunction[i];
+      }
       ++i;
     }
     lastUsedModule = M;





More information about the llvm-commits mailing list