summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-08-12 18:01:34 +0000
committerDevang Patel <dpatel@apple.com>2011-08-12 18:01:34 +0000
commitdb4374a28ae034b6971c68865bc19b790716fb64 (patch)
tree3685d2645321bbc12c68f4b58d2962b022f6ade4
parent7feabf06433e56fdfc1aaf1a6f7599ea413fe12f (diff)
downloadbcm5719-llvm-db4374a28ae034b6971c68865bc19b790716fb64.tar.gz
bcm5719-llvm-db4374a28ae034b6971c68865bc19b790716fb64.zip
Provide fast path as Jakob suggested.
llvm-svn: 137478
-rw-r--r--llvm/lib/CodeGen/LexicalScopes.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LexicalScopes.cpp b/llvm/lib/CodeGen/LexicalScopes.cpp
index 676328446f1..ae06a407037 100644
--- a/llvm/lib/CodeGen/LexicalScopes.cpp
+++ b/llvm/lib/CodeGen/LexicalScopes.cpp
@@ -256,6 +256,13 @@ getMachineBasicBlocks(DebugLoc DL,
if (!Scope)
return;
+ if (Scope == CurrentFnLexicalScope) {
+ for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
+ I != E; ++I)
+ MBBs.insert(I);
+ return;
+ }
+
SmallVector<InsnRange, 4> &InsnRanges = Scope->getRanges();
for (SmallVector<InsnRange, 4>::iterator I = InsnRanges.begin(),
E = InsnRanges.end(); I != E; ++I) {
@@ -270,6 +277,11 @@ bool LexicalScopes::dominates(DebugLoc DL, MachineBasicBlock *MBB) {
LexicalScope *Scope = getOrCreateLexicalScope(DL);
if (!Scope)
return false;
+
+ // Current function scope covers all basic blocks in the function.
+ if (Scope == CurrentFnLexicalScope && MBB->getParent() == MF)
+ return true;
+
bool Result = false;
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
I != E; ++I) {
OpenPOWER on IntegriCloud