aboutsummaryrefslogtreecommitdiff
path: root/support/lib/Support/NameMangling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'support/lib/Support/NameMangling.cpp')
-rw-r--r--support/lib/Support/NameMangling.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/support/lib/Support/NameMangling.cpp b/support/lib/Support/NameMangling.cpp
index 7dc612b271..e2c0c46507 100644
--- a/support/lib/Support/NameMangling.cpp
+++ b/support/lib/Support/NameMangling.cpp
@@ -7,28 +7,27 @@
#include "llvm/Support/NameMangling.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalValue.h"
-using std::string;
// MangleTypeName - Implement a consistent name-mangling scheme for
// a given type.
//
-string MangleTypeName(const Type *Ty) {
- string mangledName;
+std::string MangleTypeName(const Type *Ty) {
+ std::string mangledName;
if (Ty->isPrimitiveType()) {
- const string &longName = Ty->getDescription();
- return string(longName.c_str(), (longName.length() < 2) ? 1 : 2);
+ const std::string &longName = Ty->getDescription();
+ return std::string(longName.c_str(), (longName.length() < 2) ? 1 : 2);
} else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
- mangledName = string("P_" + MangleTypeName(PTy->getElementType()));
+ mangledName = std::string("P_" + MangleTypeName(PTy->getElementType()));
} else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
- mangledName = string("S_");
+ mangledName = std::string("S_");
for (unsigned i=0; i < STy->getNumContainedTypes(); ++i)
mangledName += MangleTypeName(STy->getContainedType(i));
} else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- mangledName = string("A_" +MangleTypeName(ATy->getElementType()));
+ mangledName = std::string("A_" +MangleTypeName(ATy->getElementType()));
} else if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
- mangledName = string("M_") + MangleTypeName(FTy->getReturnType());
+ mangledName = std::string("M_") + MangleTypeName(FTy->getReturnType());
for (unsigned i = 1; i < FTy->getNumContainedTypes(); ++i)
- mangledName += string(MangleTypeName(FTy->getContainedType(i)));
+ mangledName += std::string(MangleTypeName(FTy->getContainedType(i)));
}
return mangledName;
@@ -38,7 +37,7 @@ string MangleTypeName(const Type *Ty) {
// externally visible (i.e., global) objects.
// privateName should be unique within the module.
//
-string MangleName(const string &privateName, const Value *V) {
+std::string MangleName(const std::string &privateName, const Value *V) {
// Lets drop the P_ before every global name since all globals are ptrs
return privateName + "_" +
MangleTypeName(isa<GlobalValue>(V)