summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-05 00:34:14 +0000
committerDevang Patel <dpatel@apple.com>2009-09-05 00:34:14 +0000
commitf03667e20ee4a5dc6fbeb9ecf1dc6129b219032a (patch)
tree920ef431b561da44ae64c375d8c75a8e28023f4a /llvm/lib/CodeGen
parentfcc33b074b532adf79dd083cec917d583748aeec (diff)
downloadbcm5719-llvm-f03667e20ee4a5dc6fbeb9ecf1dc6129b219032a.tar.gz
bcm5719-llvm-f03667e20ee4a5dc6fbeb9ecf1dc6129b219032a.zip
Detect VLAs.
Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first. llvm-svn: 81058
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 555ef9e1b0a..cd05f7124d2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3981,7 +3981,11 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
// Don't handle byval struct arguments or VLAs, for example.
if (!AI)
return 0;
- int FI = FuncInfo.StaticAllocaMap[AI];
+ DenseMap<const AllocaInst*, int>::iterator SI =
+ FuncInfo.StaticAllocaMap.find(AI);
+ if (SI == FuncInfo.StaticAllocaMap.end())
+ return 0; // VLAs.
+ int FI = SI->second;
DW->RecordVariable(cast<MDNode>(Variable), FI);
return 0;
}
OpenPOWER on IntegriCloud