File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
llvm/lib/CodeGen/AsmPrinter Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11// REQUIRES: aarch64-registered-target
22
3- // RUN: rm -rf %t && mkdir %t && cd %t
4- // RUN: %clang_cc1 -triple aarch64-unknown -stack-usage-file b .su -emit-obj %s -o b .o
5- // RUN: FileCheck %s < b .su
3+ // RUN: rm -rf %t && split-file %s %t && cd %t
4+ // RUN: %clang_cc1 -triple aarch64-unknown -I . - stack-usage-file a .su -emit-obj a.c -o a .o
5+ // RUN: FileCheck %s < a .su
66
7- // CHECK: stack-usage.c:[[#@LINE+1]]:foo {{[0-9]+}} static
7+ // CHECK: {{.*}}x.inc:1:bar [[#]] dynamic
8+ // CHECK: a.c:2:foo [[#]] static
9+ //--- a.c
10+ #include "x.inc"
811int foo () {
912 char a [8 ];
1013
1114 return 0 ;
1215}
1316
14- // CHECK: stack-usage.c:[[#@LINE+1]]:bar {{[0-9]+}} dynamic
17+ //--- x.inc
1518int bar (int len ) {
1619 char a [len ];
1720
Original file line number Diff line number Diff line change @@ -1469,9 +1469,10 @@ void AsmPrinter::emitStackUsage(const MachineFunction &MF) {
14691469 }
14701470 }
14711471
1472- *StackUsageStream << MF.getFunction ().getParent ()->getName ();
14731472 if (const DISubprogram *DSP = MF.getFunction ().getSubprogram ())
1474- *StackUsageStream << ' :' << DSP->getLine ();
1473+ *StackUsageStream << DSP->getFilename () << ' :' << DSP->getLine ();
1474+ else
1475+ *StackUsageStream << MF.getFunction ().getParent ()->getName ();
14751476
14761477 *StackUsageStream << ' :' << MF.getName () << ' \t ' << StackSize << ' \t ' ;
14771478 if (FrameInfo.hasVarSizedObjects ())
You can’t perform that action at this time.
0 commit comments