summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-17 22:58:34 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-17 22:58:34 +0000
commit92751d41a0a09020db5868e8aafb6aef2de3ad8e (patch)
tree57fbc8fe4d663182ace304fb6c6a6d79a52d4393 /clang/lib/AST/Decl.cpp
parentc775712192b4069ea41031276662e1c2e6370e27 (diff)
downloadbcm5719-llvm-92751d41a0a09020db5868e8aafb6aef2de3ad8e.tar.gz
bcm5719-llvm-92751d41a0a09020db5868e8aafb6aef2de3ad8e.zip
Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to work around the fact that the parser and some of Sema really wanted declarators to have simple identifiers; now, the code that deals with declarators will use DeclarationNames. llvm-svn: 59469
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp52
1 files changed, 2 insertions, 50 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index dc4d6027ee8..eee934bebba 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -67,12 +67,12 @@ ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
- IdentifierInfo *Id, QualType T,
+ DeclarationName N, QualType T,
StorageClass S, bool isInline,
ScopedDecl *PrevDecl,
SourceLocation TypeSpecStartLoc) {
void *Mem = C.getAllocator().Allocate<FunctionDecl>();
- return new (Mem) FunctionDecl(Function, DC, L, Id, T, S, isInline, PrevDecl,
+ return new (Mem) FunctionDecl(Function, DC, L, N, T, S, isInline, PrevDecl,
TypeSpecStartLoc);
}
@@ -130,54 +130,6 @@ FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C,
}
//===----------------------------------------------------------------------===//
-// NamedDecl Implementation
-//===----------------------------------------------------------------------===//
-
-std::string NamedDecl::getName() const {
- switch (Name.getNameKind()) {
- case DeclarationName::Identifier:
- if (const IdentifierInfo *II = Name.getAsIdentifierInfo())
- return II->getName();
- return "";
-
- case DeclarationName::ObjCZeroArgSelector:
- case DeclarationName::ObjCOneArgSelector:
- case DeclarationName::ObjCMultiArgSelector:
- return Name.getObjCSelector().getName();
-
- case DeclarationName::CXXConstructorName: {
- QualType ClassType = Name.getCXXNameType();
- if (const RecordType *ClassRec = ClassType->getAsRecordType())
- return ClassRec->getDecl()->getName();
- return ClassType.getAsString();
- }
-
- case DeclarationName::CXXDestructorName: {
- std::string Result = "~";
- QualType Type = Name.getCXXNameType();
- if (const RecordType *Rec = Type->getAsRecordType())
- Result += Rec->getDecl()->getName();
- else
- Result += Type.getAsString();
- return Result;
- }
-
- case DeclarationName::CXXConversionFunctionName: {
- std::string Result = "operator ";
- QualType Type = Name.getCXXNameType();
- if (const RecordType *Rec = Type->getAsRecordType())
- Result += Rec->getDecl()->getName();
- else
- Result += Type.getAsString();
- return Result;
- }
- }
-
- assert(false && "Unexpected declaration name kind");
- return "";
-}
-
-//===----------------------------------------------------------------------===//
// ScopedDecl Implementation
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud