The inline asm operand modifier 'c' is suppose
authorJack Carter <jcarter@mips.com>
Thu, 21 Jun 2012 17:14:46 +0000 (17:14 +0000)
committerJack Carter <jcarter@mips.com>
Thu, 21 Jun 2012 17:14:46 +0000 (17:14 +0000)
commitd5e11ad51a3966c0b80ce2119946cd1aa3558aec
tree53bc7cad6c9e1bcccf65aed681617c4c23e522f3
parent10cefaab3fa4270396fa57b3286ab9860fafb60d
The inline asm operand modifier 'c' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Substitute immediate value without immediate syntax

Several Architectures such as x86 have local implementations
of operand modifier 'c' which go beyond the above description
slightly. To make use of the generic modifiers without overriding
local implementation one can make a call to the base class method
for AsmPrinter::PrintAsmOperand() in the locally derived method's
"default" case in the switch statement. That way if it is already
defined locally the generic version will never get called.

This change is needed when test/CodeGen/generic/asm-large-immediate.ll
failed on a native Mips board. The test was assuming a generic
implementation was in place.

Affected files:

    lib/Target/Mips/MipsAsmPrinter.cpp:
        Changed the default case to call the base method.
    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'c' to the switch cases.
    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158925 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
test/CodeGen/Mips/asm-large-immediate.ll [new file with mode: 0644]