mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-01 03:33:42 +00:00
Fix a huge bug with handling non-pointer instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5491 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
24d80079a8
commit
878e521b1e
@ -91,7 +91,7 @@ namespace {
|
||||
void visitSetCondInst(SetCondInst &SCI) {} // SetEQ & friends are ignored
|
||||
void visitFreeInst(FreeInst &FI);
|
||||
void visitCastInst(CastInst &CI);
|
||||
void visitInstruction(Instruction &I) {}
|
||||
void visitInstruction(Instruction &I);
|
||||
|
||||
private:
|
||||
// Helper functions used to implement the visitation functions...
|
||||
@ -411,6 +411,21 @@ void GraphBuilder::visitCastInst(CastInst &CI) {
|
||||
}
|
||||
|
||||
|
||||
// visitInstruction - For all other instruction types, if we have any arguments
|
||||
// that are of pointer type, make them have unknown composition bits, and merge
|
||||
// the nodes together.
|
||||
void GraphBuilder::visitInstruction(Instruction &Inst) {
|
||||
DSNodeHandle CurNode;
|
||||
if (isPointerType(Inst.getType()))
|
||||
CurNode = getValueDest(Inst);
|
||||
for (User::op_iterator I = Inst.op_begin(), E = Inst.op_end(); I != E; ++I)
|
||||
if (isPointerType((*I)->getType()))
|
||||
CurNode.mergeWith(getValueDest(**I));
|
||||
|
||||
if (CurNode.getNode())
|
||||
CurNode.getNode()->NodeType |= DSNode::UnknownNode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user