aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 05:29:24 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 05:29:24 +0000
commitd9d22dd9c94618490dbffb0e2caf222530ca39d3 (patch)
treeb93ae748c2c5dc85678512aa3c958323b717ae26 /lib/Sema/SemaDeclCXX.cpp
parente8a32b855ce4e8580a191f8d29d2f3f459834302 (diff)
Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index d9f3bc652e..b99f2e0dc1 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -938,7 +938,7 @@ bool Sema::CheckDestructorDeclarator(Declarator &D, QualType &R,
TypeDecl *DeclaratorTypeD = (TypeDecl *)D.getDeclaratorIdType();
if (const TypedefDecl *TypedefD = dyn_cast<TypedefDecl>(DeclaratorTypeD)) {
Diag(D.getIdentifierLoc(), diag::err_destructor_typedef_name)
- << TypedefD->getName();
+ << TypedefD->getDeclName();
isInvalid = true;
}
@@ -1352,7 +1352,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclTy *Dcl, SourceLocation LParenLoc,
VDecl->getLocation(),
SourceRange(VDecl->getLocation(),
RParenLoc),
- VDecl->getName(),
+ VDecl->getDeclName(),
IK_Direct);
if (!Constructor) {
RealDecl->setInvalidDecl();
@@ -1400,7 +1400,7 @@ CXXConstructorDecl *
Sema::PerformInitializationByConstructor(QualType ClassType,
Expr **Args, unsigned NumArgs,
SourceLocation Loc, SourceRange Range,
- std::string InitEntity,
+ DeclarationName InitEntity,
InitializationKind Kind) {
const RecordType *ClassRec = ClassType->getAsRecordType();
assert(ClassRec && "Can only initialize a class type here");
@@ -1810,8 +1810,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(FnDecl)) {
if (MethodDecl->isStatic())
return Diag(FnDecl->getLocation(),
- diag::err_operator_overload_static)
- << FnDecl->getName();
+ diag::err_operator_overload_static) << FnDecl->getDeclName();
} else {
bool ClassOrEnumParam = false;
for (FunctionDecl::param_iterator Param = FnDecl->param_begin(),
@@ -1827,7 +1826,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
if (!ClassOrEnumParam)
return Diag(FnDecl->getLocation(),
diag::err_operator_overload_needs_class_or_enum)
- << FnDecl->getName();
+ << FnDecl->getDeclName();
}
// C++ [over.oper]p8:
@@ -1842,7 +1841,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
if (Expr *DefArg = (*Param)->getDefaultArg())
return Diag((*Param)->getLocation(),
diag::err_operator_overload_default_arg)
- << FnDecl->getName() << DefArg->getSourceRange();
+ << FnDecl->getDeclName() << DefArg->getSourceRange();
}
}
@@ -1880,21 +1879,21 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
}
return Diag(FnDecl->getLocation(), diag::err_operator_overload_must_be)
- << FnDecl->getName() << NumParams << ErrorKind;
+ << FnDecl->getDeclName() << NumParams << ErrorKind;
}
// Overloaded operators other than operator() cannot be variadic.
if (Op != OO_Call &&
FnDecl->getType()->getAsFunctionTypeProto()->isVariadic()) {
return Diag(FnDecl->getLocation(), diag::err_operator_overload_variadic)
- << FnDecl->getName();
+ << FnDecl->getDeclName();
}
// Some operators must be non-static member functions.
if (MustBeMemberOperator && !isa<CXXMethodDecl>(FnDecl)) {
return Diag(FnDecl->getLocation(),
diag::err_operator_overload_must_be_member)
- << FnDecl->getName();
+ << FnDecl->getDeclName();
}
// C++ [over.inc]p1: