diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-11-16 18:22:08 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-11-16 18:22:08 +0000 |
commit | 6eac2ba4de0b293a627e20f5ef44d696f410b9dc (patch) | |
tree | 8d622a4665903185ef229fe27c0a1bc2223e3e62 /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 1358841e91695bd0e498c02d064c480dc53c566a (diff) |
SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.
Patch by Pekka Jääskeläinen!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 4c14aa698f..6c34eed13d 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/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 |