OSDN Git Service

[AsmPrinter] refactor to support %c w/ GlobalAddress'
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 26 Apr 2019 18:45:04 +0000 (18:45 +0000)
committerNick Desaulniers <ndesaulniers@google.com>
Fri, 26 Apr 2019 18:45:04 +0000 (18:45 +0000)
commitb3cb8ab4512cd9ffc9ce61d9c5ea244828b542cd
tree4f81d5d3ab5e1aadf526d6620e9d473f908b84cc
parent4db70c21dc6455dd9daaad4a8c6c0f5e5230a435
[AsmPrinter] refactor to support %c w/ GlobalAddress'

Summary:
Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
printing the address of a MachineOperand::MO_GlobalAddress. Move that
handling into a new overriden method in each base class. A virtual
method was added to the base class for handling the generic case.

Refactors a few subclasses to support the target independent %a, %c, and
%n.

The patch also contains small cleanups for AVRAsmPrinter and
SystemZAsmPrinter.

It seems that NVPTXTargetLowering is possibly missing some logic to
transform GlobalAddressSDNodes for
TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
inline assembly asm constraints.

Fixes:
- https://bugs.llvm.org/show_bug.cgi?id=41402
- https://github.com/ClangBuiltLinux/linux/issues/449

Reviewers: echristo, void

Reviewed By: void

Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60887

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359337 91177308-0d34-0410-b5e6-96231b3b80d8
33 files changed:
include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/Target/AArch64/AArch64AsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.h
lib/Target/AVR/AVRAsmPrinter.cpp
lib/Target/BPF/BPFAsmPrinter.cpp
lib/Target/Hexagon/HexagonAsmPrinter.cpp
lib/Target/Lanai/LanaiAsmPrinter.cpp
lib/Target/MSP430/MSP430AsmPrinter.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/SystemZ/SystemZAsmPrinter.cpp
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/XCore/XCoreAsmPrinter.cpp
test/CodeGen/AArch64/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/ARM/inlineasm-output-template.ll
test/CodeGen/BPF/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/Hexagon/inlineasm-output-template.ll
test/CodeGen/Lanai/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/MSP430/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/Mips/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/NVPTX/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/PowerPC/inlineasm-output-template.ll
test/CodeGen/SPARC/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/SystemZ/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/WebAssembly/inlineasm-output-template.ll [new file with mode: 0644]
test/CodeGen/X86/inline-asm-modifier-c.ll [new file with mode: 0644]
test/CodeGen/XCore/inlineasm-output-template.ll [new file with mode: 0644]