]> granicus.if.org Git - clang/commitdiff
Made ObjC method name mangling match GCC (which does it in a stupid and broken way...
authorDavid Chisnall <csdavec@swan.ac.uk>
Thu, 14 Jan 2010 14:08:19 +0000 (14:08 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Thu, 14 Jan 2010 14:08:19 +0000 (14:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93427 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index a8792bde955eca40a5b2c548b632551924cab8cf..e7a2093aa2e4a700016f1b590e1b6ecaff272e60 100644 (file)
@@ -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)