[llvm-commits] [llvm] r93694 - /llvm/trunk/lib/MC/MCSymbol.cpp

Chris Lattner sabre at nondot.org
Sun Jan 17 12:11:05 PST 2010


Author: lattner
Date: Sun Jan 17 14:11:03 2010
New Revision: 93694

URL: http://llvm.org/viewvc/llvm-project?rev=93694&view=rev
Log:
rename NameNeedsEscaping -> NameNeedsQuoting, eliminate the check
for first character which is a digit, mangler would have taken care
of this already.

Modified:
    llvm/trunk/lib/MC/MCSymbol.cpp

Modified: llvm/trunk/lib/MC/MCSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSymbol.cpp?rev=93694&r1=93693&r2=93694&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCSymbol.cpp (original)
+++ llvm/trunk/lib/MC/MCSymbol.cpp Sun Jan 17 14:11:03 2010
@@ -26,16 +26,11 @@
   return true;
 }
 
-/// NameNeedsEscaping - Return true if the identifier \arg Str needs quotes
-/// for this assembler.
-static bool NameNeedsEscaping(StringRef Str, const MCAsmInfo &MAI) {
+/// NameNeedsQuoting - Return true if the identifier \arg Str needs quotes to be
+/// syntactically correct.
+static bool NameNeedsQuoting(StringRef Str) {
   assert(!Str.empty() && "Cannot create an empty MCSymbol");
   
-  // If the first character is a number and the target does not allow this, we
-  // need quotes.
-  if (!MAI.doesAllowNameToStartWithDigit() && Str[0] >= '0' && Str[0] <= '9')
-    return true;
-  
   // If any of the characters in the string is an unacceptable character, force
   // quotes.
   for (unsigned i = 0, e = Str.size(); i != e; ++i)
@@ -48,7 +43,7 @@
   // The name for this MCSymbol is required to be a valid target name.  However,
   // some targets support quoting names with funny characters.  If the name
   // contains a funny character, then print it quoted.
-  if (MAI == 0 || !NameNeedsEscaping(getName(), *MAI)) {
+  if (!NameNeedsQuoting(getName())) {
     OS << getName();
     return;
   }





More information about the llvm-commits mailing list