summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSIL/MSILWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-13 23:46:46 +0000
committerChris Lattner <sabre@nondot.org>2009-07-13 23:46:46 +0000
commit874727fb7301bcd59bb0904b9556683038c6b4de (patch)
treef27da4d893d13b81b7c0a9f3088b8acecb6ec004 /llvm/lib/Target/MSIL/MSILWriter.cpp
parentd8435e998915c6cca6931b7049b2d77980262ba1 (diff)
downloadbcm5719-llvm-874727fb7301bcd59bb0904b9556683038c6b4de.tar.gz
bcm5719-llvm-874727fb7301bcd59bb0904b9556683038c6b4de.zip
fix CBE & MSIL backends to not use the mangler for non-global symbols.
llvm-svn: 75556
Diffstat (limited to 'llvm/lib/Target/MSIL/MSILWriter.cpp')
-rw-r--r--llvm/lib/Target/MSIL/MSILWriter.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/llvm/lib/Target/MSIL/MSILWriter.cpp b/llvm/lib/Target/MSIL/MSILWriter.cpp
index 8429c27eb6b..cc1bf8f1cda 100644
--- a/llvm/lib/Target/MSIL/MSILWriter.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud