mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-12 17:37:13 +00:00
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
This commit is contained in:
parent
650d7f3ff4
commit
6951381995
@ -180,7 +180,8 @@ namespace llvm {
|
|||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||||
|
|
||||||
/// getDependency - Return the instruction on which a memory operation
|
/// getDependency - Return the instruction on which a memory operation
|
||||||
/// depends. See the class comment for more details.
|
/// depends. See the class comment for more details. It is illegal to call
|
||||||
|
/// this on non-memory instructions.
|
||||||
MemDepResult getDependency(Instruction *QueryInst);
|
MemDepResult getDependency(Instruction *QueryInst);
|
||||||
|
|
||||||
/// getDependencyFrom - Return the instruction on which the memory operation
|
/// getDependencyFrom - Return the instruction on which the memory operation
|
||||||
|
@ -118,10 +118,11 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt,
|
|||||||
MemPtr = F->getPointerOperand();
|
MemPtr = F->getPointerOperand();
|
||||||
// FreeInsts erase the entire structure, not just a field.
|
// FreeInsts erase the entire structure, not just a field.
|
||||||
MemSize = ~0UL;
|
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);
|
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
|
// Walk backwards through the basic block, looking for dependencies
|
||||||
while (ScanIt != BB->begin()) {
|
while (ScanIt != BB->begin()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user