diff options
author | John McCall <rjmccall@apple.com> | 2009-08-03 20:12:06 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-08-03 20:12:06 +0000 |
commit | 49bfce4227b7b7f5806f68cdef8d969d15a203a5 (patch) | |
tree | 0183692bfa47fbdc56cb576cadaf95c8ab21c9b7 /clang/lib/Parse/Parser.cpp | |
parent | 5d8ace090276d3f68269398bf656ed976441d407 (diff) | |
download | bcm5719-llvm-49bfce4227b7b7f5806f68cdef8d969d15a203a5.tar.gz bcm5719-llvm-49bfce4227b7b7f5806f68cdef8d969d15a203a5.zip |
Refactor methods on DeclSpec to take a diagnostic& parameter, and reflect this
elsewhere. Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.
llvm-svn: 77990
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index ad68f93beba..1a082db4346 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -522,8 +522,9 @@ Parser::ParseDeclarationOrFunctionDefinition(AccessSpecifier AS) { return DeclGroupPtrTy(); } const char *PrevSpec = 0; - if (DS.SetTypeSpecType(DeclSpec::TST_unspecified, AtLoc, PrevSpec)) - Diag(AtLoc, diag::err_invalid_decl_spec_combination) << PrevSpec; + unsigned DiagID; + if (DS.SetTypeSpecType(DeclSpec::TST_unspecified, AtLoc, PrevSpec, DiagID)) + Diag(AtLoc, DiagID) << PrevSpec; DeclPtrTy TheDecl; if (Tok.isObjCAtKeyword(tok::objc_protocol)) @@ -619,9 +620,10 @@ Parser::DeclPtrTy Parser::ParseFunctionDefinition(Declarator &D, // declaration-specifiers are completely optional in the grammar. if (getLang().ImplicitInt && D.getDeclSpec().isEmpty()) { const char *PrevSpec; + unsigned DiagID; D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int, D.getIdentifierLoc(), - PrevSpec); + PrevSpec, DiagID); D.SetRangeBegin(D.getDeclSpec().getSourceRange().getBegin()); } |