diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-13 23:46:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-13 23:46:46 +0000 |
commit | ca1bafda1d72e1ef909cb8a7b1ca74e283ffea99 (patch) | |
tree | 5d887fc574e858e84886030b93030ac9535a55c9 /lib/Target/MSIL/MSILWriter.cpp | |
parent | 6dea8d31d33eb855bf42ba69bf0e8e0eb0d43b0c (diff) |
fix CBE & MSIL backends to not use the mangler for non-global symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSIL/MSILWriter.cpp')
-rw-r--r-- | lib/Target/MSIL/MSILWriter.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp index 8429c27eb6..cc1bf8f1cd 100644 --- a/lib/Target/MSIL/MSILWriter.cpp +++ b/lib/Target/MSIL/MSILWriter.cpp @@ -240,8 +240,17 @@ bool MSILWriter::isZeroValue(const Value* V) { std::string MSILWriter::getValueName(const Value* V) { + std::string Name; + if (const GlobalValue *GV = cast<GlobalValue>(V)) + Name = Mang->getValueName(GV); + else { + unsigned &No = AnonValueNumbers[V]; + if (No == 0) No = ++NextAnonValueNumber; + Name = "tmp" + utostr(No); + } + // Name into the quotes allow control and space characters. - return "'"+Mang->getValueName(V)+"'"; + return "'"+Name+"'"; } @@ -258,7 +267,16 @@ std::string MSILWriter::getLabelName(const std::string& Name) { std::string MSILWriter::getLabelName(const Value* V) { - return getLabelName(Mang->getValueName(V)); + std::string Name; + if (const GlobalValue *GV = cast<GlobalValue>(V)) + Name = Mang->getValueName(GV); + else { + unsigned &No = AnonValueNumbers[V]; + if (No == 0) No = ++NextAnonValueNumber; + Name = "tmp" + utostr(No); + } + + return getLabelName(Name); } |