Avoid collisions in value names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47725 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lauro Ramos Venancio 2008-02-28 20:26:04 +00:00
parent a4a0323f63
commit 1f4a887e32

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;
}