Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,6 @@ void AsmPrinter::emitCallGraphSection(const MachineFunction &MF,
OutStreamer->pushSection();
OutStreamer->switchSection(FuncCGSection);

const MCSymbol *FunctionSymbol = getFunctionBegin();
const Function &F = MF.getFunction();
// If this function has external linkage or has its address taken and
// it is not a callback, then anything could call it.
Expand Down Expand Up @@ -1747,7 +1746,7 @@ void AsmPrinter::emitCallGraphSection(const MachineFunction &MF,
// 8) Each unique indirect target type id.
OutStreamer->emitInt8(CallGraphSectionFormatVersion::V_0);
OutStreamer->emitInt8(static_cast<uint8_t>(CGFlags));
OutStreamer->emitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
OutStreamer->emitSymbolValue(getSymbol(&F), TM.getProgramPointerSize());
const auto *TypeId = extractNumericCGTypeId(F);
if (IsIndirectTarget && TypeId)
OutStreamer->emitInt64(TypeId->getZExtValue());
Expand Down
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/ARM/call-graph-section-addrtaken.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ entry:
}

; CHECK: _ZL10myCallbacki:
; CHECK-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
define internal void @_ZL10myCallbacki(i32 %value) !type !2 {
entry:
%sink = alloca i32, align 4
Expand All @@ -33,7 +32,7 @@ entry:
;; Flags -- Potential indirect target so LSB is set to 1. Other bits are 0.
; CHECK-NEXT: .byte 1
;; Function Entry PC
; CHECK-NEXT: .long [[LABEL_FUNC]]
; CHECK-NEXT: .long _ZL10myCallbacki
;; Function type ID -5212364466660467813
; CHECK-NEXT: .long 1154849691
; CHECK-NEXT: .long 3081369122
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/ARM/call-graph-section-assembly.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ declare !type !1 i32 @direct_bar(i8)
declare !type !2 ptr @direct_baz(ptr)

; CHECK: ball:
; CHECK-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
define ptr @ball() {
entry:
call void @direct_foo()
Expand Down Expand Up @@ -42,7 +41,7 @@ entry:
;; Flags
; CHECK-NEXT: .byte 7
;; Function Entry PC
; CHECK-NEXT: .long [[LABEL_FUNC]]
; CHECK-NEXT: .long ball
;; Function type ID -- set to 0 as no type metadata attached to function.
; CHECK-NEXT: .long 0
; CHECK-NEXT: .long 0
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/ARM/call-graph-section-tailcall.ll
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ declare !type !2 i32 @bar(i8 signext)

; CHECK: Hex dump of section '.llvm.callgraph':
; CHECK-NEXT: 0x00000000 00050000 00008e19 0b7f3326 e3000154
; CHECK-NEXT: 0x00000010 86bc5981 4b8e3000 05100000 00a150b8
; CHECK-NEXT: 0x00000010 86bc5981 4b8e3000 05000000 00a150b8
;; Verify that the type id 0x308e4b8159bc8654 is in section.
; CHECK-NEXT: 0x00000020 3e0cfe3c b2015486 bc59814b 8e30
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/X86/call-graph-section-addrtaken.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ entry:
}

; CHECK: _ZL10myCallbacki:
; CHECK-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
define internal void @_ZL10myCallbacki(i32 %value) !type !2 {
entry:
%sink = alloca i32, align 4
Expand All @@ -33,6 +32,6 @@ entry:
;; Flags -- Potential indirect target so LSB is set to 1. Other bits are 0.
; CHECK-NEXT: .byte 1
;; Function Entry PC
; CHECK-NEXT: .quad [[LABEL_FUNC]]
; CHECK-NEXT: .quad _ZL10myCallbacki
;; Function type ID
; CHECK-NEXT: .quad -5212364466660467813
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/X86/call-graph-section-assembly.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ declare !type !1 i32 @direct_bar(i8)
declare !type !2 ptr @direct_baz(ptr)

; CHECK: ball:
; CHECK-NEXT: [[LABEL_FUNC:\.Lfunc_begin[0-9]+]]:
define ptr @ball() {
entry:
call void @direct_foo()
Expand Down Expand Up @@ -42,7 +41,7 @@ entry:
;; Flags
; CHECK-NEXT: .byte 7
;; Function Entry PC
; CHECK-NEXT: .quad [[LABEL_FUNC]]
; CHECK-NEXT: .quad ball
;; Function type ID -- set to 0 as no type metadata attached to function.
; CHECK-NEXT: .quad 0
;; Number of unique direct callees.
Expand Down