[llvm-commits] [llvm] r47725 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp
Lauro Ramos Venancio
lauro.venancio at gmail.com
Thu Feb 28 12:26:05 PST 2008
Author: laurov
Date: Thu Feb 28 14:26:04 2008
New Revision: 47725
URL: http://llvm.org/viewvc/llvm-project?rev=47725&view=rev
Log:
Avoid collisions in value names.
Modified:
llvm/trunk/lib/Target/CBackend/CBackend.cpp
Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=47725&r1=47724&r2=47725&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Feb 28 14:26:04 2008
@@ -1156,9 +1156,11 @@
char ch = *I;
if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') || ch == '_'))
- VarName += '_';
- else
+ (ch >= '0' && ch <= '9') || ch == '_')) {
+ char buffer[5];
+ sprintf(buffer, "_%x_", ch);
+ VarName += buffer;
+ } else
VarName += ch;
}
More information about the llvm-commits
mailing list