[llvm-commits] CVS: llvm/lib/VMCore/Mangler.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Aug 16 23:07:05 PDT 2004
Changes in directory llvm/lib/VMCore:
Mangler.cpp updated: 1.13 -> 1.14
---
Log message:
Allow an arbitrary prefix
---
Diffs of the changes: (+3 -4)
Index: llvm/lib/VMCore/Mangler.cpp
diff -u llvm/lib/VMCore/Mangler.cpp:1.13 llvm/lib/VMCore/Mangler.cpp:1.14
--- llvm/lib/VMCore/Mangler.cpp:1.13 Thu Jul 8 17:09:34 2004
+++ llvm/lib/VMCore/Mangler.cpp Tue Aug 17 01:06:54 2004
@@ -75,8 +75,7 @@
if (gv && isa<Function>(gv) && cast<Function>(gv)->getIntrinsicID()) {
name = gv->getName(); // Is an intrinsic function
} else if (gv && !gv->hasInternalLinkage() && !MangledGlobals.count(gv)) {
- name = makeNameProper(gv->getName());
- if (AddUnderscorePrefix) name = "_" + name;
+ name = Prefix + makeNameProper(gv->getName());
} else {
// Non-global, or global with internal linkage / colliding name
// -> mangle.
@@ -115,8 +114,8 @@
}
-Mangler::Mangler(Module &m, bool addUnderscorePrefix)
- : M(m), AddUnderscorePrefix(addUnderscorePrefix), TypeCounter(0), Count(0) {
+Mangler::Mangler(Module &m, const char *prefix)
+ : M(m), Prefix(prefix), TypeCounter(0), Count(0) {
// Calculate which global values have names that will collide when we throw
// away type information.
std::map<std::string, GlobalValue*> Names;
More information about the llvm-commits
mailing list