Skip to content

Commit 0004c37

Browse files
committed
[llvm-ml] Restore VK_WEAKREF special case to fix alias.asm
1 parent 95756e6 commit 0004c37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/MC/MCExpr.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,13 @@ static bool canExpand(const MCSymbol &Sym, bool InSet) {
478478
if (Sym.isWeakExternal())
479479
return false;
480480

481-
Sym.getVariableValue(true);
481+
const MCExpr *Expr = Sym.getVariableValue(true);
482+
// Special case for llvm-ml alias
483+
const auto *Inner = dyn_cast<MCSymbolRefExpr>(Expr);
484+
if (Inner) {
485+
if (Inner->getKind() == MCSymbolRefExpr::VK_WEAKREF)
486+
return false;
487+
}
482488

483489
if (InSet)
484490
return true;

0 commit comments

Comments
 (0)