diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-02-02 16:53:06 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-02-02 16:53:06 +0000 |
commit | 46fc9fe2eb839f8fbff496e4015b1502f302e794 (patch) | |
tree | cf6d8fe1e2a19f0886f884d315a67731c4444ec4 /include/llvm/Target/TargetAsmInfo.h | |
parent | 641f12c6c27942d1b336a623954b0d44b3328fcd (diff) | |
download | external_llvm-46fc9fe2eb839f8fbff496e4015b1502f302e794.zip external_llvm-46fc9fe2eb839f8fbff496e4015b1502f302e794.tar.gz external_llvm-46fc9fe2eb839f8fbff496e4015b1502f302e794.tar.bz2 |
Made the common case of default address space directive as non-virtual for performance reasons. Provide a single virtual interface for directives of all sizes in non-default address spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetAsmInfo.h')
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index 1cd55d0..0e44666 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -298,6 +298,15 @@ namespace llvm { const char *Data32bitsDirective; // Defaults to "\t.long\t" const char *Data64bitsDirective; // Defaults to "\t.quad\t" + /// getASDirective - Targets can override it to provide different data + /// directives for various sizes and non-default address spaces. + virtual const char *getASDirective(unsigned size, + unsigned AS) const { + assert (AS > 0 + && "Dont know the directives for default addr space"); + return NULL; + } + //===--- Alignment Information ----------------------------------------===// /// AlignDirective - The directive used to emit round up to an alignment @@ -600,19 +609,20 @@ namespace llvm { // Data directive accessors // - virtual const char *getData8bitsDirective(unsigned AddrSpace = 0) const { - return Data8bitsDirective; + const char *getData8bitsDirective(unsigned AS = 0) const { + return AS == 0 ? Data8bitsDirective : getASDirective(8, AS); } - virtual const char *getData16bitsDirective(unsigned AddrSpace = 0) const { - return Data16bitsDirective; + const char *getData16bitsDirective(unsigned AS = 0) const { + return AS == 0 ? Data16bitsDirective : getASDirective(16, AS); } - virtual const char *getData32bitsDirective(unsigned AddrSpace = 0) const { - return Data32bitsDirective; + const char *getData32bitsDirective(unsigned AS = 0) const { + return AS == 0 ? Data32bitsDirective : getASDirective(32, AS); } - virtual const char *getData64bitsDirective(unsigned AddrSpace = 0) const { - return Data64bitsDirective; + const char *getData64bitsDirective(unsigned AS = 0) const { + return AS == 0 ? Data64bitsDirective : getASDirective(64, AS); } + // Accessors. // const Section *getTextSection() const { |