[llvm] a9abe1f - [COFF][CG Profile] set undefined symbol to external
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 09:50:11 PDT 2020
Author: Zequan Wu
Date: 2020-09-29T09:49:51-07:00
New Revision: a9abe1f7859e4e1293969a93213294584a5aaba9
URL: https://github.com/llvm/llvm-project/commit/a9abe1f7859e4e1293969a93213294584a5aaba9
DIFF: https://github.com/llvm/llvm-project/commit/a9abe1f7859e4e1293969a93213294584a5aaba9.diff
LOG: [COFF][CG Profile] set undefined symbol to external
Differential Revision: https://reviews.llvm.org/D88456
Added:
Modified:
llvm/lib/MC/MCWinCOFFStreamer.cpp
llvm/test/MC/COFF/cgprofile.s
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp
index d8fde4004d44..520d4a024691 100644
--- a/llvm/lib/MC/MCWinCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp
@@ -340,10 +340,8 @@ void MCWinCOFFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {
const MCSymbol *S = &SRE->getSymbol();
bool Created;
getAssembler().registerSymbol(*S, &Created);
- if (Created) {
- cast<MCSymbolCOFF>(S)->setIsWeakExternal();
+ if (Created)
cast<MCSymbolCOFF>(S)->setExternal(true);
- }
}
void MCWinCOFFStreamer::finalizeCGProfile() {
diff --git a/llvm/test/MC/COFF/cgprofile.s b/llvm/test/MC/COFF/cgprofile.s
index a0c47a69c069..c2f95038b370 100644
--- a/llvm/test/MC/COFF/cgprofile.s
+++ b/llvm/test/MC/COFF/cgprofile.s
@@ -30,7 +30,7 @@ late3:
# CHECK-NEXT: ]
# CHECK-NEXT: SectionData (
# CHECK-NEXT: 0000: 0A000000 0E000000 20000000 00000000
-# CHECK-NEXT: 0010: 11000000 0A000000 0B000000 00000000
+# CHECK-NEXT: 0010: 0F000000 0A000000 0B000000 00000000
# CHECK-NEXT: 0020: 0B000000 0C000000 14000000 00000000
# CHECK-NEXT: )
@@ -68,37 +68,15 @@ late3:
# CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
# CHECK-NEXT: BaseType:
# CHECK-NEXT: ComplexType:
-# CHECK-NEXT: StorageClass: WeakExternal
-# CHECK-NEXT: AuxSymbolCount: 1
-# CHECK-NEXT: AuxWeakExternal {
-# CHECK-NEXT: Linked: .weak.b.default.late
-# CHECK-NEXT: Search: Alias
-# CHECK-NEXT: }
-# CHECK: Name: .weak.b.default.late
-# CHECK-NEXT: Value:
-# CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE
-# CHECK-NEXT: BaseType:
-# CHECK-NEXT: ComplexType:
# CHECK-NEXT: StorageClass: External
-# CHECK-NEXT: AuxSymbolCount: 0
+# CHECK-NEXT: AuxSymbolCount:
# CHECK: Name: freq
# CHECK-NEXT: Value:
# CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
# CHECK-NEXT: BaseType:
# CHECK-NEXT: ComplexType:
-# CHECK-NEXT: StorageClass: WeakExternal
-# CHECK-NEXT: AuxSymbolCount: 1
-# CHECK-NEXT: AuxWeakExternal {
-# CHECK-NEXT: Linked: .weak.freq.default.late
-# CHECK-NEXT: Search: Alias
-# CHECK-NEXT: }
-# CHECK: Name: .weak.freq.default.late
-# CHECK-NEXT: Value:
-# CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE
-# CHECK-NEXT: BaseType:
-# CHECK-NEXT: ComplexType:
# CHECK-NEXT: StorageClass: External
-# CHECK-NEXT: AuxSymbolCount: 0
+# CHECK-NEXT: AuxSymbolCount:
# CHECK: CGProfile [
# CHECK-NEXT: CGProfileEntry {
More information about the llvm-commits
mailing list