ScopInfo: Ensure the RegionInfo analysis is always available

This fixes a crash that appeared when generating dotty graphs for functions
without loops (for which we do not calculate polyhedral information).

llvm-svn: 198364
This commit is contained in:
Tobias Grosser 2014-01-02 22:28:53 +00:00
parent 860fa9052e
commit 9a26f2986c
1 changed files with 1 additions and 1 deletions

View File

@ -714,12 +714,12 @@ void ScopDetection::printLocations(llvm::Function &F) {
bool ScopDetection::runOnFunction(llvm::Function &F) {
LI = &getAnalysis<LoopInfo>();
RI = &getAnalysis<RegionInfo>();
if (!DetectScopsWithoutLoops && LI->empty())
return false;
AA = &getAnalysis<AliasAnalysis>();
SE = &getAnalysis<ScalarEvolution>();
RI = &getAnalysis<RegionInfo>();
Region *TopRegion = RI->getTopLevelRegion();
releaseMemory();