mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Fix some problems with assertions printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10129 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7334f2e3da
commit
15e8752e8f
@ -155,18 +155,30 @@ namespace { // Anonymous namespace for class
|
|||||||
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
|
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
|
||||||
void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
|
void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
|
||||||
|
|
||||||
|
|
||||||
|
void WriteValue(const Value *V) {
|
||||||
|
if (!V) return;
|
||||||
|
if (isa<Instruction>(V))
|
||||||
|
std::cerr << *V;
|
||||||
|
else {
|
||||||
|
WriteAsOperand (std::cerr, V, true, true, Mod);
|
||||||
|
std::cerr << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// CheckFailed - A check failed, so print out the condition and the message
|
// CheckFailed - A check failed, so print out the condition and the message
|
||||||
// that failed. This provides a nice place to put a breakpoint if you want
|
// that failed. This provides a nice place to put a breakpoint if you want
|
||||||
// to see why something is not correct.
|
// to see why something is not correct.
|
||||||
//
|
//
|
||||||
inline void CheckFailed(const std::string &Message,
|
void CheckFailed(const std::string &Message,
|
||||||
const Value *V1 = 0, const Value *V2 = 0,
|
const Value *V1 = 0, const Value *V2 = 0,
|
||||||
const Value *V3 = 0, const Value *V4 = 0) {
|
const Value *V3 = 0, const Value *V4 = 0) {
|
||||||
std::cerr << Message << "\n";
|
std::cerr << Message << "\n";
|
||||||
if (V1) { WriteAsOperand (std::cerr, V1, true, true, Mod); std::cerr << "\n"; }
|
WriteValue(V1);
|
||||||
if (V2) { WriteAsOperand (std::cerr, V2, true, true, Mod); std::cerr << "\n"; }
|
WriteValue(V2);
|
||||||
if (V3) { WriteAsOperand (std::cerr, V3, true, true, Mod); std::cerr << "\n"; }
|
WriteValue(V3);
|
||||||
if (V4) { WriteAsOperand (std::cerr, V4, true, true, Mod); std::cerr << "\n"; }
|
WriteValue(V4);
|
||||||
Broken = true;
|
Broken = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user