diff options
author | Richard Trieu <rtrieu@google.com> | 2018-03-28 04:16:13 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-03-28 04:16:13 +0000 |
commit | b402580616617a5c2d80f3d1c343b8f74bd7c3b5 (patch) | |
tree | d360a3d9382d397d8da2c23771a4e3a6f56bbe55 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | a95b0df5eddbe7fa1e9f8fe0b1ff62427e1c0318 (diff) | |
download | bcm5719-llvm-b402580616617a5c2d80f3d1c343b8f74bd7c3b5.tar.gz bcm5719-llvm-b402580616617a5c2d80f3d1c343b8f74bd7c3b5.zip |
Fix some handling of AST nodes with diagnostics.
The diagnostic system for Clang can already handle many AST nodes. Instead
of converting them to strings first, just hand the AST node directly to
the diagnostic system and let it handle the output. Minor changes in some
diagnostic output.
llvm-svn: 328688
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 6160eccabe8..a56869f6234 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -2404,7 +2404,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecordDecl *Class, // The Microsoft extension __interface does not permit bases that // are not themselves public interfaces. Diag(KnownBase->getLocStart(), diag::err_invalid_base_in_interface) - << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getName() + << getRecordDiagFromTagKind(RD->getTagKind()) << RD << RD->getSourceRange(); Invalid = true; } @@ -2862,7 +2862,7 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc, if (AS_none != CXXRecordDecl::MergeAccess(P.Access, BaseField->getAccess())) { Diag(Loc, diag::warn_shadow_field) - << FieldName.getAsString() << RD->getName() << Base->getName(); + << FieldName << RD << Base; Diag(BaseField->getLocation(), diag::note_shadow_field); Bases.erase(It); } @@ -5528,7 +5528,7 @@ static void ReferenceDllExportedMembers(Sema &S, CXXRecordDecl *Class) { S.MarkFunctionReferenced(Class->getLocation(), MD); if (Trap.hasErrorOccurred()) { S.Diag(ClassAttr->getLocation(), diag::note_due_to_dllexported_class) - << Class->getName() << !S.getLangOpts().CPlusPlus11; + << Class << !S.getLangOpts().CPlusPlus11; break; } |