mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
Print InlinedAt location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
33634d0672
commit
e025e966a8
@ -450,14 +450,11 @@ void AsmPrinter::EmitFunctionEntryLabel() {
|
||||
}
|
||||
|
||||
|
||||
/// EmitComments - Pretty-print comments for instructions.
|
||||
static void EmitComments(const MachineInstr &MI, raw_ostream &CommentOS) {
|
||||
const MachineFunction *MF = MI.getParent()->getParent();
|
||||
const TargetMachine &TM = MF->getTarget();
|
||||
|
||||
DebugLoc DL = MI.getDebugLoc();
|
||||
static void EmitDebugLoc(DebugLoc DL, const MachineFunction *MF,
|
||||
raw_ostream &CommentOS) {
|
||||
const LLVMContext &Ctx = MF->getFunction()->getContext();
|
||||
if (!DL.isUnknown()) { // Print source line info.
|
||||
DIScope Scope(DL.getScope(MF->getFunction()->getContext()));
|
||||
DIScope Scope(DL.getScope(Ctx));
|
||||
// Omit the directory, because it's likely to be long and uninteresting.
|
||||
if (Scope.Verify())
|
||||
CommentOS << Scope.getFilename();
|
||||
@ -466,6 +463,23 @@ static void EmitComments(const MachineInstr &MI, raw_ostream &CommentOS) {
|
||||
CommentOS << ':' << DL.getLine();
|
||||
if (DL.getCol() != 0)
|
||||
CommentOS << ':' << DL.getCol();
|
||||
DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(DL.getInlinedAt(Ctx));
|
||||
if (!InlinedAtDL.isUnknown()) {
|
||||
CommentOS << "[ ";
|
||||
EmitDebugLoc(InlinedAtDL, MF, CommentOS);
|
||||
CommentOS << " ]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// EmitComments - Pretty-print comments for instructions.
|
||||
static void EmitComments(const MachineInstr &MI, raw_ostream &CommentOS) {
|
||||
const MachineFunction *MF = MI.getParent()->getParent();
|
||||
const TargetMachine &TM = MF->getTarget();
|
||||
|
||||
DebugLoc DL = MI.getDebugLoc();
|
||||
if (!DL.isUnknown()) { // Print source line info.
|
||||
EmitDebugLoc(DL, MF, CommentOS);
|
||||
CommentOS << '\n';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user