[llvm-commits] [poolalloc] r114042 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Will Dietz
wdietz2 at illinois.edu
Wed Sep 15 16:24:27 PDT 2010
Author: wdietz2
Date: Wed Sep 15 18:24:26 2010
New Revision: 114042
URL: http://llvm.org/viewvc/llvm-project?rev=114042&view=rev
Log:
Don't clone main!
Fixes 'Fptr' and 'Fptr_helper', still need to explore this behavior
with external code like 'qsort'.
Modified:
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=114042&r1=114041&r2=114042&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Wed Sep 15 18:24:26 2010
@@ -168,6 +168,7 @@
// FIXME: Should use a isClone() method.
//
std::set<Function*> ClonedFunctions;
+ Function *MainFunc = M.getFunction("main");
while (FunctionsToClone.size()) {
//
// Remove a function from the list of functions to clone.
@@ -175,6 +176,11 @@
Function * Original = FunctionsToClone.back();
FunctionsToClone.pop_back ();
+ // Don't clone 'main'!
+ if (Original == MainFunc) {
+ continue;
+ }
+
//
// Clone the function. Record a pointer to the new clone if one was
// created.
More information about the llvm-commits
mailing list