aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 03:33:13 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 03:33:13 +0000
commit077bf5e2f48acfa9e7d69429b6e4ba86ea14896d (patch)
tree55c540d3cfe45fb990f27b56635fcec5865bcc16 /lib/Sema/SemaDeclObjC.cpp
parentd0fd3b747c46211c481021ffb9cabd5635f918ed (diff)
Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index cc54e890cf..64fd6c515d 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -805,8 +805,7 @@ void Sema::AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method) {
if (!match) {
// We have a new signature for an existing method - add it.
// This is extremely rare. Only 1% of Cocoa selectors are "overloaded".
- struct ObjCMethodList *OMI = new ObjCMethodList(Method, FirstMethod.Next);
- FirstMethod.Next = OMI;
+ FirstMethod.Next = new ObjCMethodList(Method, FirstMethod.Next);;
}
}
}
@@ -824,7 +823,7 @@ ObjCMethodDecl *Sema::LookupInstanceMethodInGlobalPool(Selector Sel,
issueWarning = true;
}
if (issueWarning && (MethList.Method && MethList.Next)) {
- Diag(R.getBegin(), diag::warn_multiple_method_decl) << Sel.getName() << R;
+ Diag(R.getBegin(), diag::warn_multiple_method_decl) << Sel << R;
Diag(MethList.Method->getLocStart(), diag::note_using_decl)
<< MethList.Method->getSourceRange();
for (ObjCMethodList *Next = MethList.Next; Next; Next = Next->Next)
@@ -905,7 +904,7 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl,
if (isInterfaceDeclKind && PrevMethod && !match
|| checkIdenticalMethods && match) {
Diag(Method->getLocation(), diag::err_duplicate_method_decl)
- << Method->getSelector().getName();
+ << Method->getDeclName();
Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
} else {
insMethods.push_back(Method);
@@ -922,7 +921,7 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl,
if (isInterfaceDeclKind && PrevMethod && !match
|| checkIdenticalMethods && match) {
Diag(Method->getLocation(), diag::err_duplicate_method_decl)
- << Method->getSelector().getName();
+ << Method->getDeclName();
Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
} else {
clsMethods.push_back(Method);
@@ -1115,7 +1114,7 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration(
if (PrevMethod) {
// You can never have two method definitions with the same name.
Diag(ObjCMethod->getLocation(), diag::err_duplicate_method_decl)
- << ObjCMethod->getSelector().getName();
+ << ObjCMethod->getDeclName();
Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
}
return ObjCMethod;