OSDN Git Service

Merging r368477:
authorHans Wennborg <hans@hanshq.net>
Tue, 13 Aug 2019 12:07:33 +0000 (12:07 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 13 Aug 2019 12:07:33 +0000 (12:07 +0000)
commit93f085c4aef0eb66410595b055fb921f62411e61
tree0dbe42d6c347bd38a4f2518406d4af671fd0efb5
parentccc886d363982d2deb7861fc59d5617d707ac126
Merging r368477:
------------------------------------------------------------------------
r368477 | void | 2019-08-09 22:16:31 +0200 (Fri, 09 Aug 2019) | 22 lines

[MC] Don't recreate a label if it's already used

Summary:
This patch keeps track of MCSymbols created for blocks that were
referenced in inline asm. It prevents creating a new symbol which
doesn't refer to the block.

Inline asm may have a reference to a label. The asm parser however
doesn't recognize it as a label and tries to create a new symbol. The
result being that instead of the original symbol (e.g. ".Ltmp0") the
parser replaces it in the inline asm with the new one (e.g. ".Ltmp00")
without updating it in the symbol table. So the machine basic block
retains the "old" symbol (".Ltmp0"), but the inline asm uses the new one
(".Ltmp00").

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65304
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368676 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCContext.h
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/MC/MCContext.cpp
lib/MC/MCParser/AsmParser.cpp
test/CodeGen/AArch64/callbr-asm-label.ll [new file with mode: 0644]
test/CodeGen/X86/callbr-asm-label-addr.ll [new file with mode: 0644]
test/CodeGen/X86/callbr-asm.ll