diff options
Diffstat (limited to 'lib/Target/ARM/ARMTargetAsmInfo.cpp')
| -rw-r--r-- | lib/Target/ARM/ARMTargetAsmInfo.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp index 81bec51..7afbab3 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -17,7 +17,7 @@ #include <cctype> using namespace llvm; -const char *const llvm::arm_asm_table[] = { +static const char *const arm_asm_table[] = { "{r0}", "r0", "{r1}", "r1", "{r2}", "r2", @@ -42,10 +42,21 @@ const char *const llvm::arm_asm_table[] = { "{cc}", "cc", 0,0}; -TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>); +ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { + AsmTransCBE = arm_asm_table; + + AlignmentIsInBytes = false; + Data64bitsDirective = 0; + CommentString = "@"; + ConstantPoolSection = "\t.text\n"; + COMMDirectiveTakesAlignment = false; + InlineAsmStart = "@ InlineAsm Start"; + InlineAsmEnd = "@ InlineAsm End"; + LCOMMDirective = "\t.lcomm\t"; +} ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM): - ARMTargetAsmInfo<DarwinTargetAsmInfo>(TM) { + ARMTargetAsmInfo(TM), DarwinTargetAsmInfo(TM) { Subtarget = &DTM->getSubtarget<ARMSubtarget>(); GlobalPrefix = "_"; @@ -93,7 +104,7 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM): } ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM): - ARMTargetAsmInfo<ELFTargetAsmInfo>(TM) { + ARMTargetAsmInfo(TM), ELFTargetAsmInfo(TM) { Subtarget = &ETM->getSubtarget<ARMSubtarget>(); NeedsSet = false; @@ -127,15 +138,13 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM): /// Count the number of comma-separated arguments. /// Do not try to detect errors. -template <class BaseTAI> -unsigned ARMTargetAsmInfo<BaseTAI>::countArguments(const char* p) const { +unsigned ARMTargetAsmInfo::countArguments(const char* p) const { unsigned count = 0; while (*p && isspace(*p) && *p != '\n') p++; count++; - while (*p && *p!='\n' && - strncmp(p, BaseTAI::CommentString, - strlen(BaseTAI::CommentString))!=0) { + while (*p && *p!='\n' && + strncmp(p, CommentString, strlen(CommentString))!=0) { if (*p==',') count++; p++; @@ -145,8 +154,7 @@ unsigned ARMTargetAsmInfo<BaseTAI>::countArguments(const char* p) const { /// Count the length of a string enclosed in quote characters. /// Do not try to detect errors. -template <class BaseTAI> -unsigned ARMTargetAsmInfo<BaseTAI>::countString(const char* p) const { +unsigned ARMTargetAsmInfo::countString(const char* p) const { unsigned count = 0; while (*p && isspace(*p) && *p!='\n') p++; @@ -158,8 +166,7 @@ unsigned ARMTargetAsmInfo<BaseTAI>::countString(const char* p) const { } /// ARM-specific version of TargetAsmInfo::getInlineAsmLength. -template <class BaseTAI> -unsigned ARMTargetAsmInfo<BaseTAI>::getInlineAsmLength(const char *s) const { +unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *s) const { // Make a lowercase-folded version of s for counting purposes. char *q, *s_copy = (char *)malloc(strlen(s) + 1); strcpy(s_copy, s); @@ -185,7 +192,7 @@ unsigned ARMTargetAsmInfo<BaseTAI>::getInlineAsmLength(const char *s) const { break; } // Ignore everything from comment char(s) to EOL - if (strncmp(Str, BaseTAI::CommentString, strlen(BaseTAI::CommentString))==-0) + if (strncmp(Str, CommentString, strlen(CommentString))==-0) atInsnStart = false; // FIXME do something like the following for non-Darwin else if (*Str == '.' && Subtarget->isTargetDarwin()) { @@ -275,7 +282,7 @@ unsigned ARMTargetAsmInfo<BaseTAI>::getInlineAsmLength(const char *s) const { Length += 4; // ARM } } - if (*Str == '\n' || *Str == BaseTAI::SeparatorChar) + if (*Str == '\n' || *Str == SeparatorChar) atInsnStart = true; } free(s_copy); |
