[llvm-commits] [llvm] r77873 - in /llvm/trunk/lib/Target/ARM: ARMTargetAsmInfo.cpp ARMTargetAsmInfo.h

Chris Lattner sabre at nondot.org
Sat Aug 1 21:52:00 PDT 2009


Author: lattner
Date: Sat Aug  1 23:52:00 2009
New Revision: 77873

URL: http://llvm.org/viewvc/llvm-project?rev=77873&view=rev
Log:
turn some templated inline functions into static functions.

Modified:
    llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
    llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h

Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=77873&r1=77872&r2=77873&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Sat Aug  1 23:52:00 2009
@@ -83,15 +83,15 @@
 
 /// Count the number of comma-separated arguments.
 /// Do not try to detect errors.
-template <class BaseTAI>
-unsigned ARMTargetAsmInfo<BaseTAI>::countArguments(const char* p) const {
+static unsigned countArguments(const char* p,
+                               const TargetAsmInfo &TAI) {
   unsigned count = 0;
   while (*p && isspace(*p) && *p != '\n')
     p++;
   count++;
   while (*p && *p!='\n' &&
-         strncmp(p, BaseTAI::CommentString,
-                 strlen(BaseTAI::CommentString))!=0) {
+         strncmp(p, TAI.getCommentString(),
+                 strlen(TAI.getCommentString())) != 0) {
     if (*p==',')
       count++;
     p++;
@@ -101,8 +101,7 @@
 
 /// 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 {
+static unsigned countString(const char *p) {
   unsigned count = 0;
   while (*p && isspace(*p) && *p!='\n')
     p++;
@@ -197,17 +196,17 @@
         // Some generate code, but this is only interesting in the text section.
         else if (inTextSection) {
           if (strncmp(Str, ".long", strlen(".long"))==0)
-            Length += 4*countArguments(Str+strlen(".long"));
+            Length += 4*countArguments(Str+strlen(".long"), *this);
           else if (strncmp(Str, ".short", strlen(".short"))==0)
-            Length += 2*countArguments(Str+strlen(".short"));
+            Length += 2*countArguments(Str+strlen(".short"), *this);
           else if (strncmp(Str, ".byte", strlen(".byte"))==0)
-            Length += 1*countArguments(Str+strlen(".byte"));
+            Length += 1*countArguments(Str+strlen(".byte"), *this);
           else if (strncmp(Str, ".single", strlen(".single"))==0)
-            Length += 4*countArguments(Str+strlen(".single"));
+            Length += 4*countArguments(Str+strlen(".single"), *this);
           else if (strncmp(Str, ".double", strlen(".double"))==0)
-            Length += 8*countArguments(Str+strlen(".double"));
+            Length += 8*countArguments(Str+strlen(".double"), *this);
           else if (strncmp(Str, ".quad", strlen(".quad"))==0)
-            Length += 16*countArguments(Str+strlen(".quad"));
+            Length += 16*countArguments(Str+strlen(".quad"), *this);
           else if (strncmp(Str, ".ascii", strlen(".ascii"))==0)
             Length += countString(Str+strlen(".ascii"));
           else if (strncmp(Str, ".asciz", strlen(".asciz"))==0)

Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h?rev=77873&r1=77872&r2=77873&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h Sat Aug  1 23:52:00 2009
@@ -40,8 +40,6 @@
     const ARMSubtarget *Subtarget;
 
     virtual unsigned getInlineAsmLength(const char *Str) const;
-    unsigned countArguments(const char *p) const;
-    unsigned countString(const char *p) const;
   };
 
   EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>);





More information about the llvm-commits mailing list