diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-01 15:34:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-01 15:34:37 +0000 |
commit | 62a60c50f4fb78f731d4b9d02ad9905afe588671 (patch) | |
tree | 3fd4cedd06bd58d1aa76fe4be7b73d7e0ada13d6 /clang/lib/Sema/SemaDecl.cpp | |
parent | cb95eeecc6c334b043ace0f94c69ba1491f46f5f (diff) | |
download | bcm5719-llvm-62a60c50f4fb78f731d4b9d02ad9905afe588671.tar.gz bcm5719-llvm-62a60c50f4fb78f731d4b9d02ad9905afe588671.zip |
Revert r126737, the most recent nested-name-specifier location change, for buildbot breakage.
llvm-svn: 126746
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 25ac11a6f8f..062971724c1 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -17,7 +17,6 @@ #include "clang/Sema/CXXFieldCollector.h" #include "clang/Sema/Scope.h" #include "clang/Sema/ScopeInfo.h" -#include "TypeLocBuilder.h" #include "clang/AST/APValue.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" @@ -62,8 +61,7 @@ Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup(Decl *Ptr) { ParsedType Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec *SS, bool isClassName, bool HasTrailingDot, - ParsedType ObjectTypePtr, - bool WantNontrivialTypeSourceInfo) { + ParsedType ObjectTypePtr) { // Determine where we will perform name lookup. DeclContext *LookupCtx = 0; if (ObjectTypePtr) { @@ -89,15 +87,11 @@ ParsedType Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, // We know from the grammar that this name refers to a type, // so build a dependent node to describe the type. - if (WantNontrivialTypeSourceInfo) - return ActOnTypenameType(S, SourceLocation(), *SS, II, NameLoc).get(); - - NestedNameSpecifierLoc QualifierLoc = SS->getWithLocInContext(Context); QualType T = - CheckTypenameType(ETK_None, SourceLocation(), QualifierLoc, + CheckTypenameType(ETK_None, SourceLocation(), + SS->getWithLocInContext(Context), II, NameLoc); - - return ParsedType::make(T); + return ParsedType::make(T); } return ParsedType(); @@ -196,21 +190,9 @@ ParsedType Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, if (T.isNull()) T = Context.getTypeDeclType(TD); - if (SS && SS->isNotEmpty()) { - if (WantNontrivialTypeSourceInfo) { - // Construct a type with type-source information. - TypeLocBuilder Builder; - Builder.pushTypeSpec(T).setNameLoc(NameLoc); - - T = getElaboratedType(ETK_None, *SS, T); - ElaboratedTypeLoc ElabTL = Builder.push<ElaboratedTypeLoc>(T); - ElabTL.setKeywordLoc(SourceLocation()); - ElabTL.setQualifierLoc(SS->getWithLocInContext(Context)); - return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T)); - } else { - T = getElaboratedType(ETK_None, *SS, T); - } - } + if (SS) + T = getElaboratedType(ETK_None, *SS, T); + } else if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(IIDecl)) { if (!HasTrailingDot) T = Context.getObjCInterfaceType(IDecl); |