Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
[oota-llvm.git] / lib / VMCore / Mangler.cpp
index e0e224826dea64bf81f825d5fa74a89013297f6e..a5fbf264c62cfa77757a618cacd5b6a43ca00679 100644 (file)
@@ -47,8 +47,9 @@ std::string Mangler::makeNameProper(const std::string &X,
       ++I;  // Skip over the marker.
     }
     
-    // Mangle the first letter specially, don't allow numbers.
-    if (*I >= '0' && *I <= '9')
+    // Mangle the first letter specially, don't allow numbers unless the target
+    // explicitly allows them.
+    if (!SymbolsCanStartWithDigit && *I >= '0' && *I <= '9')
       Result += MangleLetter(*I++);
 
     for (std::string::const_iterator E = X.end(); I != E; ++I) {