aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-02 06:34:04 +0000
committerChris Lattner <sabre@nondot.org>2009-11-02 06:34:04 +0000
commitff3ca159512c7e7a406e2ceb68c298460aa5c27a (patch)
tree5cf1763f25b5641f16cba0aa91a05203c707edfe /lib/Transforms
parente01985c95f63e96f3620c27fee6d8b33c2d0bbf8 (diff)
don't mark the arguments of prototype overdefined, they will never be queried.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 553c94bebc..c11380abf5 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1646,16 +1646,19 @@ bool IPSCCP::runOnModule(Module &M) {
// Loop over all functions, marking arguments to those with their addresses
// taken or that are external as overdefined.
//
- for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
+ for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
+ if (F->isDeclaration())
+ continue;
+
if (!F->hasLocalLinkage() || AddressIsTaken(F)) {
- if (!F->isDeclaration())
- Solver.MarkBlockExecutable(F->begin());
+ Solver.MarkBlockExecutable(F->begin());
for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
AI != E; ++AI)
Solver.markOverdefined(AI);
} else {
Solver.AddTrackedFunction(F);
}
+ }
// Loop over global variables. We inform the solver about any internal global
// variables that do not have their 'addresses taken'. If they don't have