Avoid collisions in value names.

llvm-svn: 47725
This commit is contained in:
Lauro Ramos Venancio 2008-02-28 20:26:04 +00:00
parent 0c2f26dd17
commit 9781aee03c
1 changed files with 5 additions and 3 deletions

View File

@ -1156,9 +1156,11 @@ std::string CWriter::GetValueName(const Value *Operand) {
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;
}