]> granicus.if.org Git - clang/commitdiff
Fixed a bug which exposed the internally built type to user code.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Nov 2007 22:00:55 +0000 (22:00 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Nov 2007 22:00:55 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43987 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp

index 7ba743cf5ea657f1c7f4d5c00d70a40b3fe9ca3f..006bb18bd16a8625c2b7de6c3cf7f170eaa50e25 100644 (file)
@@ -551,8 +551,13 @@ Sema::ObjcActOnMethodDefinition(Scope *S, DeclTy *D, DeclTy *lastDecl) {
   ObjcMethodDecl *MDecl = dyn_cast<ObjcMethodDecl>(static_cast<Decl *>(D));
   
   ScopedDecl *LastDeclarator = dyn_cast_or_null<ScopedDecl>((Decl *)lastDecl);
-  const char *name = MDecl->getSelector().getName().c_str();
-  IdentifierInfo *II = &Context.Idents.get(name);
+  // build [classname selector-name] for the name of method.
+  std::string Name = "[";
+  Name += MDecl->getClassInterface()->getName();
+  Name += " ";
+  Name += MDecl->getSelector().getName();
+  Name += "]";
+  IdentifierInfo *II = &Context.Idents.get(Name);
   assert (II && "ObjcActOnMethodDefinition - selector name is missing");
   
   // The scope passed in may not be a decl scope.  Zip up the scope tree until