summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-23 21:45:46 +0000
committerChris Lattner <sabre@nondot.org>2008-11-23 21:45:46 +0000
commite3d20d954503fef1256b50977f7e2c9507452c1e (patch)
tree8473d3824da844a9fcc3808aa798a1bdcf5b2b16 /clang/lib/Sema/SemaDeclObjC.cpp
parentf7e69d5a77b21fd98e29df84411506527faa62b3 (diff)
downloadbcm5719-llvm-e3d20d954503fef1256b50977f7e2c9507452c1e.tar.gz
bcm5719-llvm-e3d20d954503fef1256b50977f7e2c9507452c1e.zip
Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on effects and requires tweaking to a whole lot of code. This causes a regression in two tests (xfailed) by causing it to emit things like: Line 10: duplicate interface declaration for category 'MyClass1' ('Category1') instead of: Line 10: duplicate interface declaration for category 'MyClass1(Category1)' I will fix this in a follow-up commit. As part of this, I had to start switching stuff to use ->getDeclName() instead of Decl::getName() for consistency. This is good, but I was planning to do this as an independent patch. There will be several follow-on patches to clean up some of the mess, but this patch is already too big. llvm-svn: 59917
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index bac483153cc..49bfad7634e 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -111,7 +111,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
<< SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
else if (SuperClassEntry->isForwardDecl())
Diag(SuperLoc, diag::err_undef_superclass)
- << SuperClassEntry->getName() << ClassName
+ << SuperClassEntry->getDeclName() << ClassName
<< SourceRange(AtInterfaceLoc, ClassLoc);
}
IDecl->setSuperClass(SuperClassEntry);
@@ -481,7 +481,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
// This implementation and its interface do not have the same
// super class.
Diag(SuperClassLoc, diag::err_conflicting_super_class)
- << SDecl->getName();
+ << SDecl->getDeclName();
Diag(SDecl->getLocation(), diag::err_previous_definition);
}
}
@@ -553,17 +553,16 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
if (Context.getCanonicalType(ImplIvar->getType()) !=
Context.getCanonicalType(ClsIvar->getType())) {
Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_type)
- << ImplIvar->getIdentifier();
- Diag(ClsIvar->getLocation(), diag::err_previous_definition)
- << ClsIvar->getIdentifier();
+ << ImplIvar->getIdentifier()
+ << ImplIvar->getType() << ClsIvar->getType();
+ Diag(ClsIvar->getLocation(), diag::err_previous_definition);
}
// TODO: Two mismatched (unequal width) Ivar bitfields should be diagnosed
// as error.
else if (ImplIvar->getIdentifier() != ClsIvar->getIdentifier()) {
Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_name)
- << ImplIvar->getIdentifier();
- Diag(ClsIvar->getLocation(), diag::err_previous_definition)
- << ClsIvar->getIdentifier();
+ << ImplIvar->getIdentifier() << ClsIvar->getIdentifier();
+ Diag(ClsIvar->getLocation(), diag::err_previous_definition);
return;
}
--numIvars;
@@ -581,7 +580,7 @@ void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method,
Diag(ImpLoc, diag::warn_incomplete_impl);
IncompleteImpl = true;
}
- Diag(ImpLoc, diag::warn_undef_method_impl) << method->getSelector().getName();
+ Diag(ImpLoc, diag::warn_undef_method_impl) << method->getDeclName();
}
/// FIXME: Type hierarchies in Objective-C can be deep. We could most
OpenPOWER on IntegriCloud