[all-commits] [llvm/llvm-project] 1d5758: X86: Support dollar symbol for AT&T syntax and add...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Jul 11 20:52:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d5758705dade80baf509dab5ea1808a38608ee0
      https://github.com/llvm/llvm-project/commit/1d5758705dade80baf509dab5ea1808a38608ee0
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.h
    M llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h
    A llvm/test/CodeGen/X86/dollar-name-asm.ll
    M llvm/test/CodeGen/X86/dollar-name.ll
    M llvm/tools/llc/llc.cpp

  Log Message:
  -----------
  X86: Support dollar symbol for AT&T syntax and add output-asm-variant to llc

'$' indicates immediate values in AT&T syntax, so symbol names starting
with '$' need to be quoted or wrapped in parentheses. Parentheses are
preferred to support expressions with relocation specifiers without
modifying MCExpr internals, aligning with GCC (https://gcc.gnu.org/PR91298).

Add `-output-asm-variant` to llc for testing Intel syntax, avoiding
`-x86-asm-syntax` which affects MCAsmInfo used by input assembly
(-x86-asm-syntax=intel doesn't work with AT&T module asm)

Note: In these positions the symbol name cannot be quoted: `$var:`
`.globl $var` `.type $var, @object`

Close #147587

Pull Request: https://github.com/llvm/llvm-project/pull/147876



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list