[llvm] 48263bd - Revert "[MC] Remove assert to work around BOLT"
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 08:43:03 PDT 2024
Author: Davide Italiano
Date: 2024-07-02T08:41:24-07:00
New Revision: 48263bd7e7a8b9f8de3cb9757008dd1b2b104802
URL: https://github.com/llvm/llvm-project/commit/48263bd7e7a8b9f8de3cb9757008dd1b2b104802
DIFF: https://github.com/llvm/llvm-project/commit/48263bd7e7a8b9f8de3cb9757008dd1b2b104802.diff
LOG: Revert "[MC] Remove assert to work around BOLT"
This reverts commit c72cb2766cec0ac519a051780ae5aed42485e012.
The patch was not reviewed, and this assertion guards against incorrect
values for symbols if the linker decides to modify the layout as it
happens on some platforms. getSymbolOffset() is used for code size
estimation, among others.
Reverting for now, until we get proper code review and undersatnding of
the implications.
Added:
Modified:
llvm/lib/MC/MCAssembler.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 14790f508323e..4cafec6024a7e 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -538,6 +538,7 @@ bool MCAssembler::getSymbolOffset(const MCSymbol &S, uint64_t &Val) const {
}
uint64_t MCAssembler::getSymbolOffset(const MCSymbol &S) const {
+ assert(HasLayout);
uint64_t Val;
getSymbolOffsetImpl(*this, S, true, Val);
return Val;
More information about the llvm-commits
mailing list