MipsAsmParser/O32: Don't add redundant $ to $-prefixed symbol in the la macro (#80644)
authorYunQiang Su <syq@debian.org>
Wed, 14 Feb 2024 20:48:55 +0000 (04:48 +0800)
committerTom Stellard <tstellar@redhat.com>
Fri, 16 Feb 2024 06:13:32 +0000 (22:13 -0800)
commit9cf0c2962fd26b6fc9a665b75732b44b1603e1ee
tree9123cb07a4019e66fc6ff232ad0261e1e8e3a21b
parente3c6d5abb1a8a4bfb40fdccc5ceda8e5377167b6
MipsAsmParser/O32: Don't add redundant $ to $-prefixed symbol in the la macro (#80644)

When parsing the `la` macro, we add a duplicate `$` prefix in
`getOrCreateSymbol`,
leading to `error: Undefined temporary symbol $$yy` for code like:

```
xx:
la $2,$yy
$yy:
nop
```

Remove the duplicate prefix.

In addition, recognize `.L`-prefixed symbols as local for O32.

See: #65020.

---------

Co-authored-by: Fangrui Song <i@maskray.me>
(cherry picked from commit c007fbb19879f9b597b47ae772c53e53cdc65f29)
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/test/CodeGen/Mips/hf1_body.ll
llvm/test/MC/Mips/macro-la-pic.s