summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Mangler.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-05 20:17:53 +0000
committerChris Lattner <sabre@nondot.org>2004-04-05 20:17:53 +0000
commitc97b7b2285d5559cfed277b514ac3a5c87167d7a (patch)
treeeed53f1e32a3232fca1f8ce32b94ae07dc7284a6 /llvm/lib/Support/Mangler.cpp
parent0f1df36bdd709020d56c5f8998e0e922d3f8646e (diff)
downloadbcm5719-llvm-c97b7b2285d5559cfed277b514ac3a5c87167d7a.tar.gz
bcm5719-llvm-c97b7b2285d5559cfed277b514ac3a5c87167d7a.zip
Do not mangle intrinsics in any way!
llvm-svn: 12673
Diffstat (limited to 'llvm/lib/Support/Mangler.cpp')
-rw-r--r--llvm/lib/Support/Mangler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/Mangler.cpp b/llvm/lib/Support/Mangler.cpp
index 0982efd8cd9..0705c9b608c 100644
--- a/llvm/lib/Support/Mangler.cpp
+++ b/llvm/lib/Support/Mangler.cpp
@@ -56,13 +56,16 @@ std::string Mangler::getValueName(const Value *V) {
std::string name;
if (V->hasName()) { // Print out the label if it exists...
// Name mangling occurs as follows:
+ // - If V is an intrinsic function, do not change name at all
// - If V is not a global, mangling always occurs.
// - Otherwise, mangling occurs when any of the following are true:
// 1) V has internal linkage
// 2) V's name would collide if it is not mangled.
//
const GlobalValue* gv = dyn_cast<GlobalValue>(V);
- if (gv && !gv->hasInternalLinkage() && !MangledGlobals.count(gv)) {
+ 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;
} else {
OpenPOWER on IntegriCloud