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 | 6951381995f24dc9c7bbcacefd5a1315784f66f3 (patch) | |
tree | 083b2188be6f984863a4f049e302dcb5c65558ff /lib/Analysis/MemoryDependenceAnalysis.cpp | |
parent | 650d7f3ff4d22646def71b842f7f163c539e0aaf (diff) |
Make it illegal to call getDependency* on non-memory instructions
like binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index c47ec0493a..c75cbf2c59 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/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()) { |