projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8832924
)
SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.
author
Hans Wennborg
<hans@hanshq.net>
Fri, 16 Nov 2012 18:22:08 +0000
(18:22 +0000)
committer
Hans Wennborg
<hans@hanshq.net>
Fri, 16 Nov 2012 18:22:08 +0000
(18:22 +0000)
Patch by Pekka Jääskeläinen!
llvm-svn: 168176
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index
4c14aa6
..
6c34eed
100644
(file)
--- a/
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@
-3539,7
+3539,8
@@
static bool SwitchToLookupTable(SwitchInst *SI,
assert(SI->getNumCases() > 1 && "Degenerate switch?");
// Only build lookup table when we have a target that supports it.
- if (!TTI || !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
+ if (!TTI || !TTI->getScalarTargetTransformInfo() ||
+ !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
return false;
// FIXME: If the switch is too sparse for a lookup table, perhaps we could