aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2010-01-14 14:08:19 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2010-01-14 14:08:19 +0000
commitd346736dfe5ef584a2d0c9d27d217408ee394b9b (patch)
tree39b057cab984e808756059d6c8286450cc34ece1
parent7b81e8fe6f8576340af7899c1828f1af0781d775 (diff)
Made ObjC method name mangling match GCC (which does it in a stupid and broken way that can give conflicts on method names containing underscores, but is needed for gdb to work because gdb does not know how to read ObjC class tables and relies on the mangling).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93427 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index a8792bde95..e7a2093aa2 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -217,8 +217,11 @@ static std::string SymbolNameForClass(const std::string &ClassName) {
static std::string SymbolNameForMethod(const std::string &ClassName, const
std::string &CategoryName, const std::string &MethodName, bool isClassMethod)
{
- return "_OBJC_METHOD_" + ClassName + "("+CategoryName+")"+
- (isClassMethod ? "+" : "-") + MethodName;
+ std::string MethodNameColonStripped = MethodName;
+ std::replace(MethodNameColonStripped.begin(), MethodNameColonStripped.end(),
+ ':', '_');
+ return std::string(isClassMethod ? "_c_" : "_i_") + ClassName + "_" +
+ CategoryName + "_" + MethodNameColonStripped;
}
CGObjCGNU::CGObjCGNU(CodeGen::CodeGenModule &cgm)