[llvm] c72cb27 - [MC] Remove assert to work around BOLT
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 20:41:20 PDT 2024
Author: Fangrui Song
Date: 2024-07-01T20:41:15-07:00
New Revision: c72cb2766cec0ac519a051780ae5aed42485e012
URL: https://github.com/llvm/llvm-project/commit/c72cb2766cec0ac519a051780ae5aed42485e012
DIFF: https://github.com/llvm/llvm-project/commit/c72cb2766cec0ac519a051780ae5aed42485e012.diff
LOG: [MC] Remove assert to work around BOLT
BOLT used a dummy `MCAsmLayout` to call `getSymbolOffset`, which is
technically not supported. There is some discussion in
https://reviews.llvm.org/D154604 that this is not ideal.
For now, remove the assert.
The assert was added by bbb50369a149d9a7d1f91efaaabf75c260a220c7.
Added:
Modified:
llvm/lib/MC/MCAssembler.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 4cafec6024a7e..14790f508323e 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -538,7 +538,6 @@ 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