diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-12-05 18:46:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-12-05 18:46:19 +0000 |
| commit | eda6432bebef94e2a254889e7879c9bc261efd5a (patch) | |
| tree | 09f45c75dce06dacd631d5d0ab5abafa148e2223 /llvm/lib/Analysis | |
| parent | 88909849bbb32c8fe94e6aa323d8130dbe0a88d5 (diff) | |
| download | bcm5719-llvm-eda6432bebef94e2a254889e7879c9bc261efd5a.tar.gz bcm5719-llvm-eda6432bebef94e2a254889e7879c9bc261efd5a.zip | |
Make it illegal to call getDependency* on non-memory instructions
like binary operators.
llvm-svn: 60600
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index c47ec0493a5..c75cbf2c59f 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -118,10 +118,11 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt, MemPtr = F->getPointerOperand(); // FreeInsts erase the entire structure, not just a field. MemSize = ~0UL; - } else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) + } else { + assert((isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) && + "Can only get dependency info for memory instructions!"); return getCallSiteDependency(CallSite::get(QueryInst), ScanIt, BB); - else // Non-memory instructions depend on nothing. - return MemDepResult::getNone(); + } // Walk backwards through the basic block, looking for dependencies while (ScanIt != BB->begin()) { |

