From b3a51061b1b9c4add078237850649f7c9efb13ab Mon Sep 17 00:00:00 2001 From: rdivacky Date: Thu, 5 Nov 2009 17:18:09 +0000 Subject: Update clang to r86140. --- include/clang/AST/ASTConsumer.h | 19 ++++++------ include/clang/Analysis/PathDiagnostic.h | 14 +++++++-- .../clang/Analysis/PathSensitive/AnalysisManager.h | 7 +++++ include/clang/Analysis/PathSensitive/BugType.h | 4 +-- include/clang/Analysis/PathSensitive/Checker.h | 8 +++-- .../Checkers/UndefinedAssignmentChecker.h | 3 +- .../clang/Analysis/PathSensitive/GRExprEngine.h | 14 ++++----- include/clang/Basic/Diagnostic.h | 29 ++++++++++++------ include/clang/Basic/DiagnosticGroups.td | 2 ++ include/clang/Basic/DiagnosticParseKinds.td | 3 -- include/clang/Basic/DiagnosticSemaKinds.td | 16 +++++++++- include/clang/Frontend/ASTConsumers.h | 10 +++---- include/clang/Frontend/AnalysisConsumer.h | 5 +--- include/clang/Frontend/InitPreprocessor.h | 16 +++++++--- include/clang/Frontend/PathDiagnosticClients.h | 26 ++-------------- include/clang/Frontend/TextDiagnosticPrinter.h | 8 +++-- include/clang/Frontend/Utils.h | 1 - include/clang/Lex/Preprocessor.h | 20 +++---------- include/clang/Parse/Action.h | 35 +++++++++++++++++++--- include/clang/Parse/DeclSpec.h | 12 +++++++- include/clang/Parse/Parser.h | 7 ----- include/clang/Rewrite/HTMLRewrite.h | 7 ++--- 22 files changed, 156 insertions(+), 110 deletions(-) (limited to 'include/clang') diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h index af6bf30..53bb785 100644 --- a/include/clang/AST/ASTConsumer.h +++ b/include/clang/AST/ASTConsumer.h @@ -38,17 +38,17 @@ public: virtual ~ASTConsumer() {} /// Initialize - This is called to initialize the consumer, providing the - /// ASTContext and the Action. + /// ASTContext. virtual void Initialize(ASTContext &Context) {} /// HandleTopLevelDecl - Handle the specified top-level declaration. This is - /// called by the parser to process every top-level Decl*. Note that D can - /// be the head of a chain of Decls (e.g. for `int a, b` the chain will have - /// two elements). Use Decl::getNextDeclarator() to walk the chain. + /// called by the parser to process every top-level Decl*. Note that D can be + /// the head of a chain of Decls (e.g. for `int a, b` the chain will have two + /// elements). Use Decl::getNextDeclarator() to walk the chain. virtual void HandleTopLevelDecl(DeclGroupRef D); /// HandleTranslationUnit - This method is called when the ASTs for entire - /// translation unit have been parsed. + /// translation unit have been parsed. virtual void HandleTranslationUnit(ASTContext &Ctx) {} /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl @@ -57,9 +57,9 @@ public: /// can be defined in declspecs). virtual void HandleTagDeclDefinition(TagDecl *D) {} - /// \brief Callback invoked at the end of a translation unit to - /// notify the consumer that the given tentative definition should - /// be completed. + /// CompleteTentativeDefinition - Callback invoked at the end of a translation + /// unit to notify the consumer that the given tentative definition should be + /// completed. /// /// The variable declaration itself will be a tentative /// definition. If it had an incomplete array type, its type will @@ -69,8 +69,7 @@ public: virtual void CompleteTentativeDefinition(VarDecl *D) {} /// PrintStats - If desired, print any statistics. - virtual void PrintStats() { - } + virtual void PrintStats() {} // Support isa/cast/dyn_cast static bool classof(const ASTConsumer *) { return true; } diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Analysis/PathDiagnostic.h index a08afe2..efc6677 100644 --- a/include/clang/Analysis/PathDiagnostic.h +++ b/include/clang/Analysis/PathDiagnostic.h @@ -43,8 +43,18 @@ class Preprocessor; class PathDiagnosticClient : public DiagnosticClient { public: PathDiagnosticClient() {} - virtual ~PathDiagnosticClient() {} - virtual void SetPreprocessor(Preprocessor *PP) {} + + virtual ~PathDiagnosticClient() {}; + + virtual void + FlushDiagnostics(llvm::SmallVectorImpl *FilesMade = 0) = 0; + + void FlushDiagnostics(llvm::SmallVectorImpl &FilesMade) { + FlushDiagnostics(&FilesMade); + } + + virtual llvm::StringRef getName() const = 0; + virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, const DiagnosticInfo &Info); virtual void HandlePathDiagnostic(const PathDiagnostic* D) = 0; diff --git a/include/clang/Analysis/PathSensitive/AnalysisManager.h b/include/clang/Analysis/PathSensitive/AnalysisManager.h index 1a64f56..4883346 100644 --- a/include/clang/Analysis/PathSensitive/AnalysisManager.h +++ b/include/clang/Analysis/PathSensitive/AnalysisManager.h @@ -66,6 +66,8 @@ public: VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge), EagerlyAssume(eager), TrimGraph(trim) {} + ~AnalysisManager() { FlushDiagnostics(); } + void ClearContexts() { LocCtxMgr.clear(); AnaCtxMgr.clear(); @@ -98,6 +100,11 @@ public: virtual PathDiagnosticClient *getPathDiagnosticClient() { return PD.get(); } + + void FlushDiagnostics() { + if (PD.get()) + PD->FlushDiagnostics(); + } bool shouldVisualizeGraphviz() const { return VisualizeEGDot; } diff --git a/include/clang/Analysis/PathSensitive/BugType.h b/include/clang/Analysis/PathSensitive/BugType.h index 46b3edd..242b8e9 100644 --- a/include/clang/Analysis/PathSensitive/BugType.h +++ b/include/clang/Analysis/PathSensitive/BugType.h @@ -64,10 +64,10 @@ protected: const std::string desc; public: BuiltinBug(GRExprEngine *eng, const char* n, const char* d) - : BugType(n, "Logic errors"), Eng(*eng), desc(d) {} + : BugType(n, "Logic error"), Eng(*eng), desc(d) {} BuiltinBug(GRExprEngine *eng, const char* n) - : BugType(n, "Logic errors"), Eng(*eng), desc(n) {} + : BugType(n, "Logic error"), Eng(*eng), desc(n) {} const std::string &getDescription() const { return desc; } diff --git a/include/clang/Analysis/PathSensitive/Checker.h b/include/clang/Analysis/PathSensitive/Checker.h index 3bef08d..4fc0a61 100644 --- a/include/clang/Analysis/PathSensitive/Checker.h +++ b/include/clang/Analysis/PathSensitive/Checker.h @@ -116,12 +116,13 @@ private: void GR_VisitBind(ExplodedNodeSet &Dst, GRStmtNodeBuilder &Builder, GRExprEngine &Eng, - const Stmt *stmt, ExplodedNode *Pred, void *tag, + const Stmt *AssignE, + const Stmt *StoreE, ExplodedNode *Pred, void *tag, SVal location, SVal val, bool isPrevisit) { CheckerContext C(Dst, Builder, Eng, Pred, tag, isPrevisit); assert(isPrevisit && "Only previsit supported for now."); - PreVisitBind(C, stmt, location, val); + PreVisitBind(C, AssignE, StoreE, location, val); } public: @@ -135,7 +136,8 @@ public: return Pred; } - virtual void PreVisitBind(CheckerContext &C, const Stmt *ST, + virtual void PreVisitBind(CheckerContext &C, + const Stmt *AssignE, const Stmt *StoreE, SVal location, SVal val) {} virtual ExplodedNode *CheckType(QualType T, ExplodedNode *Pred, diff --git a/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h b/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h index 7fee501..13437eb 100644 --- a/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h +++ b/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h @@ -24,7 +24,8 @@ class UndefinedAssignmentChecker public: UndefinedAssignmentChecker() : BT(0) {} static void *getTag(); - virtual void PreVisitBind(CheckerContext &C, const Stmt *S, SVal location, + virtual void PreVisitBind(CheckerContext &C, const Stmt *AssignE, + const Stmt *StoreE, SVal location, SVal val); }; } diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h index 2f2a11a..25e4703 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -412,7 +412,8 @@ protected: void CheckerVisit(Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, bool isPrevisit); - void CheckerVisitBind(Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, + void CheckerVisitBind(const Stmt *AssignE, const Stmt *StoreE, + ExplodedNodeSet &Dst, ExplodedNodeSet &Src, SVal location, SVal val, bool isPrevisit); @@ -566,7 +567,8 @@ protected: /// EvalBind - Handle the semantics of binding a value to a specific location. /// This method is used by EvalStore, VisitDeclStmt, and others. - void EvalBind(ExplodedNodeSet& Dst, Stmt* Ex, ExplodedNode* Pred, + void EvalBind(ExplodedNodeSet& Dst, Stmt *AssignE, + Stmt* StoreE, ExplodedNode* Pred, const GRState* St, SVal location, SVal Val, bool atDeclInit = false); @@ -578,14 +580,10 @@ public: const GRState* St, SVal location, const void *tag = 0); - - void EvalStore(ExplodedNodeSet& Dst, Expr* E, ExplodedNode* Pred, const GRState* St, - SVal TargetLV, SVal Val, const void *tag = 0); - - void EvalStore(ExplodedNodeSet& Dst, Expr* E, Expr* StoreE, ExplodedNode* Pred, + void EvalStore(ExplodedNodeSet& Dst, Expr* AssignE, Expr* StoreE, + ExplodedNode* Pred, const GRState* St, SVal TargetLV, SVal Val, const void *tag = 0); - }; } // end clang namespace diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 005aab3..77a2079 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -769,17 +769,28 @@ class DiagnosticClient { public: virtual ~DiagnosticClient(); - /// setLangOptions - This is set by clients of diagnostics when they know the - /// language parameters of the diagnostics that may be sent through. Note - /// that this can change over time if a DiagClient has multiple languages sent - /// through it. It may also be set to null (e.g. when processing command line - /// options). - virtual void setLangOptions(const LangOptions *LO) {} + /// BeginSourceFile - Callback to inform the diagnostic client that processing + /// of a source file is beginning. + /// + /// Note that diagnostics may be emitted outside the processing of a source + /// file, for example during the parsing of command line options. However, + /// diagnostics with source range information are required to only be emitted + /// in between BeginSourceFile() and EndSourceFile(). + /// + /// \arg LO - The language options for the source file being processed. + /// \arg PP - The preprocessor object being used for the source; this optional + /// and may not be present, for example when processing AST source files. + virtual void BeginSourceFile(const LangOptions &LangOpts) {} + + /// EndSourceFile - Callback to inform the diagnostic client that processing + /// of a source file has ended. The diagnostic client should assume that any + /// objects made available via \see BeginSourceFile() are inaccessible. + virtual void EndSourceFile() {} /// IncludeInDiagnosticCounts - This method (whose default implementation - /// returns true) indicates whether the diagnostics handled by this - /// DiagnosticClient should be included in the number of diagnostics - /// reported by Diagnostic. + /// returns true) indicates whether the diagnostics handled by this + /// DiagnosticClient should be included in the number of diagnostics reported + /// by Diagnostic. virtual bool IncludeInDiagnosticCounts() const; /// HandleDiagnostic - Handle this diagnostic, reporting it to the user or diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index c34bdc1..8cfdd40 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -23,6 +23,7 @@ def : DiagGroup<"address">; def : DiagGroup<"aggregate-return">; def : DiagGroup<"attributes">; def : DiagGroup<"bad-function-cast">; +def : DiagGroup<"c++-compat">; def : DiagGroup<"cast-align">; def : DiagGroup<"cast-qual">; def : DiagGroup<"char-align">; @@ -47,6 +48,7 @@ def : DiagGroup<"invalid-pch">; def : DiagGroup<"missing-braces">; def : DiagGroup<"missing-declarations">; def : DiagGroup<"missing-format-attribute">; +def : DiagGroup<"missing-include-dirs">; def : DiagGroup<"missing-noreturn">; def MultiChar : DiagGroup<"multichar">; def : DiagGroup<"nested-externs">; diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index db8d580..e173cff 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -166,9 +166,6 @@ def err_use_of_tag_name_without_tag : Error< "use of tagged type %0 without '%1' tag">; def err_expected_ident_in_using : Error< "expected an identifier in using directive">; -def err_using_decl_can_not_refer_to_template_spec : Error< - "using declaration can not refer to template specialization">; - /// Objective-C parser diagnostics def err_objc_no_attributes_on_category : Error< diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 99fddb5..2309908 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -107,8 +107,14 @@ def err_using_decl_nested_name_specifier_is_not_a_base_class : Error< "using declaration refers into '%0', which is not a base class of %1">; def err_using_decl_can_not_refer_to_class_member : Error< "using declaration can not refer to class member">; - def err_using_decl_can_not_refer_to_namespace : Error< +def err_using_decl_can_not_refer_to_namespace : Error< "using declaration can not refer to namespace">; +def err_using_decl_constructor : Error< + "using declaration can not refer to a constructor">; +def err_using_decl_destructor : Error< + "using declaration can not refer to a destructor">; +def err_using_decl_template_id : Error< + "using declaration can not refer to a template specialization">; def err_invalid_thread : Error< "'__thread' is only allowed on variable declarations">; @@ -512,6 +518,8 @@ def err_init_reference_member_uninitialized : Error< "reference member of type %0 uninitialized">; def note_uninit_reference_member : Note< "uninitialized reference member is here">; +def warn_field_is_uninit : Warning<"field is uninitialized when used here">, + InGroup>; // C++0x decltype def err_cannot_determine_declared_type_of_overloaded_function : Error< @@ -1529,6 +1537,12 @@ def err_typecheck_vector_comparison : Error< def err_typecheck_assign_const : Error<"read-only variable is not assignable">; def err_stmtexpr_file_scope : Error< "statement expression not allowed at file scope">; +def warn_mixed_sign_comparison : Warning< + "comparison of integers of different signs: %0 and %1">, + InGroup>; +def warn_mixed_sign_conditional : Warning< + "operands of ? are integers of different signs: %0 and %1">, + InGroup>; def err_invalid_this_use : Error< "invalid use of 'this' outside of a nonstatic member function">; diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h index f59a0a7..742813c 100644 --- a/include/clang/Frontend/ASTConsumers.h +++ b/include/clang/Frontend/ASTConsumers.h @@ -28,7 +28,6 @@ class ASTConsumer; class Diagnostic; class FileManager; class Preprocessor; -class PreprocessorFactory; class CompileOptions; class LangOptions; @@ -86,10 +85,11 @@ ASTConsumer *CreateBackendConsumer(BackendAction Action, llvm::raw_ostream *OS, llvm::LLVMContext& C); -// HTML printer: uses the rewriter to convert source code to HTML with -// syntax highlighting suitable for viewing in a web-browser. -ASTConsumer* CreateHTMLPrinter(llvm::raw_ostream *OS, Diagnostic &D, - Preprocessor *PP, PreprocessorFactory *PPF); +/// CreateHTMLPrinter - Create an AST consumer which rewrites source code to +/// HTML with syntax highlighting suitable for viewing in a web-browser. +ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP, + bool SyntaxHighlight = true, + bool HighlightMacros = true); // PCH generator: generates a precompiled header file; this file can be // used later with the PCHReader (clang-cc option -include-pch) diff --git a/include/clang/Frontend/AnalysisConsumer.h b/include/clang/Frontend/AnalysisConsumer.h index 0e4b09b..34054a7 100644 --- a/include/clang/Frontend/AnalysisConsumer.h +++ b/include/clang/Frontend/AnalysisConsumer.h @@ -19,7 +19,6 @@ namespace clang { class ASTConsumer; class Diagnostic; class Preprocessor; -class PreprocessorFactory; class LangOptions; /// Analysis - Set of available source code analyses. @@ -69,9 +68,7 @@ struct AnalyzerOptions { /// CreateAnalysisConsumer - Creates an ASTConsumer to run various code /// analysis passes. (The set of analyses run is controlled by command-line /// options.) -ASTConsumer* CreateAnalysisConsumer(Diagnostic &diags, Preprocessor *pp, - PreprocessorFactory *ppf, - const LangOptions &lopts, +ASTConsumer* CreateAnalysisConsumer(const Preprocessor &pp, const std::string &output, const AnalyzerOptions& Opts); diff --git a/include/clang/Frontend/InitPreprocessor.h b/include/clang/Frontend/InitPreprocessor.h index b29ee27..415acea 100644 --- a/include/clang/Frontend/InitPreprocessor.h +++ b/include/clang/Frontend/InitPreprocessor.h @@ -29,7 +29,16 @@ class PreprocessorInitOptions { std::vector > Includes; std::vector MacroIncludes; + unsigned UsePredefines : 1; /// Initialize the preprocessor with the compiler + /// and target specific predefines. + public: + PreprocessorInitOptions() : UsePredefines(true) {} + + bool getUsePredefines() const { return UsePredefines; } + void setUsePredefines(bool Value) { + UsePredefines = Value; + } void addMacroDef(const std::string &Name) { Macros.push_back(std::make_pair(Name, false)); @@ -60,11 +69,10 @@ public: }; /// InitializePreprocessor - Initialize the preprocessor getting it and the -/// environment ready to process a single file. This returns true on error. +/// environment ready to process a single file. /// -bool InitializePreprocessor(Preprocessor &PP, - const PreprocessorInitOptions& InitOptions, - bool undef_macros); +void InitializePreprocessor(Preprocessor &PP, + const PreprocessorInitOptions& InitOptions); } // end namespace clang diff --git a/include/clang/Frontend/PathDiagnosticClients.h b/include/clang/Frontend/PathDiagnosticClients.h index 8cb6898..98831ba 100644 --- a/include/clang/Frontend/PathDiagnosticClients.h +++ b/include/clang/Frontend/PathDiagnosticClients.h @@ -22,33 +22,13 @@ namespace clang { class PathDiagnosticClient; class Preprocessor; -class PreprocessorFactory; - -class PathDiagnosticClientFactory { -public: - PathDiagnosticClientFactory() {} - virtual ~PathDiagnosticClientFactory() {} - - virtual const char *getName() const = 0; - - virtual PathDiagnosticClient* - createPathDiagnosticClient(llvm::SmallVectorImpl *FilesMade) = 0; -}; PathDiagnosticClient* -CreateHTMLDiagnosticClient(const std::string& prefix, Preprocessor* PP = 0, - PreprocessorFactory* PPF = 0, - llvm::SmallVectorImpl* FilesMade = 0); - -PathDiagnosticClientFactory* -CreateHTMLDiagnosticClientFactory(const std::string& prefix, - Preprocessor* PP = 0, - PreprocessorFactory* PPF = 0); +CreateHTMLDiagnosticClient(const std::string& prefix, const Preprocessor &PP); PathDiagnosticClient* -CreatePlistDiagnosticClient(const std::string& prefix, Preprocessor* PP, - PreprocessorFactory* PPF, - PathDiagnosticClientFactory *PF = 0); +CreatePlistDiagnosticClient(const std::string& prefix, const Preprocessor &PP, + PathDiagnosticClient *SubPD = 0); } // end clang namespace #endif diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h index 98e5a75..3c5c626 100644 --- a/include/clang/Frontend/TextDiagnosticPrinter.h +++ b/include/clang/Frontend/TextDiagnosticPrinter.h @@ -39,8 +39,12 @@ class TextDiagnosticPrinter : public DiagnosticClient { public: TextDiagnosticPrinter(llvm::raw_ostream &os, const DiagnosticOptions &diags); - void setLangOptions(const LangOptions *LO) { - LangOpts = LO; + void BeginSourceFile(const LangOptions &LO) { + LangOpts = &LO; + } + + void EndSourceFile() { + LangOpts = 0; } void PrintIncludeStack(SourceLocation Loc, const SourceManager &SM); diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index 9cbcf8e..3c67028 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -30,7 +30,6 @@ class Diagnostic; class ASTConsumer; class IdentifierTable; class SourceManager; -class PreprocessorFactory; class LangOptions; class Decl; class Stmt; diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 35960ff..2783716 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -96,7 +96,7 @@ class Preprocessor { /// Identifiers - This is mapping/lookup information for all identifiers in /// the program, including program keywords. - IdentifierTable Identifiers; + mutable IdentifierTable Identifiers; /// Selectors - This table contains all the selectors in the program. Unlike /// IdentifierTable above, this table *isn't* populated by the preprocessor. @@ -296,12 +296,8 @@ public: /// pointers is preferred unless the identifier is already available as a /// string (this avoids allocation and copying of memory to construct an /// std::string). - IdentifierInfo *getIdentifierInfo(const char *NameStart, - const char *NameEnd) { - return &Identifiers.get(NameStart, NameEnd); - } - IdentifierInfo *getIdentifierInfo(const char *NameStr) { - return getIdentifierInfo(NameStr, NameStr+strlen(NameStr)); + IdentifierInfo *getIdentifierInfo(llvm::StringRef Name) const { + return &Identifiers.get(Name); } /// AddPragmaHandler - Add the specified pragma handler to the preprocessor. @@ -583,7 +579,7 @@ public: /// LookUpIdentifierInfo - Given a tok::identifier token, look up the /// identifier information for the token and install it into the token. IdentifierInfo *LookUpIdentifierInfo(Token &Identifier, - const char *BufPtr = 0); + const char *BufPtr = 0) const; /// HandleIdentifier - This callback is invoked when the lexer reads an /// identifier and has filled in the tokens IdentifierInfo member. This @@ -831,14 +827,6 @@ public: void HandleComment(SourceRange Comment); }; -/// PreprocessorFactory - A generic factory interface for lazily creating -/// Preprocessor objects on-demand when they are needed. -class PreprocessorFactory { -public: - virtual ~PreprocessorFactory(); - virtual Preprocessor* CreatePreprocessor() = 0; -}; - /// \brief Abstract base class that describes a handler that will receive /// source ranges for each of the comments encountered in the source file. class CommentHandler { diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 073365d..657a14f 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -1174,14 +1174,41 @@ public: return DeclPtrTy(); } - /// ActOnUsingDirective - This is called when using-directive is parsed. + /// \brief Parsed a C++ using-declaration. + /// + /// This callback will be invoked when the parser has parsed a C++ + /// using-declaration, e.g., + /// + /// \code + /// namespace std { + /// template class vector; + /// } + /// + /// using std::vector; // using-declaration here + /// \endcode + /// + /// \param CurScope the scope in which this using declaration was parsed. + /// + /// \param AS the currently-active access specifier. + /// + /// \param UsingLoc the location of the 'using' keyword. + /// + /// \param SS the nested-name-specifier that precedes the name. + /// + /// \param Name the name to which the using declaration refers. + /// + /// \param AttrList attributes applied to this using declaration, if any. + /// + /// \param IsTypeName whether this using declaration started with the + /// 'typename' keyword. FIXME: This will eventually be split into a + /// separate action. + /// + /// \returns a representation of the using declaration. virtual DeclPtrTy ActOnUsingDeclaration(Scope *CurScope, AccessSpecifier AS, SourceLocation UsingLoc, const CXXScopeSpec &SS, - SourceLocation IdentLoc, - IdentifierInfo *TargetName, - OverloadedOperatorKind Op, + UnqualifiedId &Name, AttributeList *AttrList, bool IsTypeName); diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index dccb8bc..d539508 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -131,6 +131,9 @@ private: // friend-specifier bool Friend_specified : 1; + // constexpr-specifier + bool Constexpr_specified : 1; + /// TypeRep - This contains action-specific information about a specific TST. /// For example, for a typedef or struct, it might contain the declaration for /// these. @@ -155,7 +158,7 @@ private: SourceLocation TSWLoc, TSCLoc, TSSLoc, TSTLoc; SourceLocation TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc; SourceLocation FS_inlineLoc, FS_virtualLoc, FS_explicitLoc; - SourceLocation FriendLoc; + SourceLocation FriendLoc, ConstexprLoc; DeclSpec(const DeclSpec&); // DO NOT IMPLEMENT void operator=(const DeclSpec&); // DO NOT IMPLEMENT @@ -174,6 +177,7 @@ public: FS_virtual_specified(false), FS_explicit_specified(false), Friend_specified(false), + Constexpr_specified(false), TypeRep(0), AttrList(0), ProtocolQualifiers(0), @@ -309,9 +313,15 @@ public: bool SetFriendSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID); + bool SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, + unsigned &DiagID); + bool isFriendSpecified() const { return Friend_specified; } SourceLocation getFriendSpecLoc() const { return FriendLoc; } + bool isConstexprSpecified() const { return Constexpr_specified; } + SourceLocation getConstexprSpecLoc() const { return ConstexprLoc; } + /// AddAttributes - contatenates two attribute lists. /// The GCC attribute syntax allows for the following: /// diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index f34d469..1ca92ed 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1321,13 +1321,6 @@ private: UnqualifiedId &Result); //===--------------------------------------------------------------------===// - // C++ 13.5: Overloaded operators [over.oper] - // EndLoc, if non-NULL, is filled with the location of the last token of - // the ID. - OverloadedOperatorKind TryParseOperatorFunctionId(SourceLocation *EndLoc = 0); - TypeTy *ParseConversionFunctionId(SourceLocation *EndLoc = 0); - - //===--------------------------------------------------------------------===// // C++ 14: Templates [temp] typedef llvm::SmallVector TemplateParameterList; diff --git a/include/clang/Rewrite/HTMLRewrite.h b/include/clang/Rewrite/HTMLRewrite.h index f77e0c6..88caf85 100644 --- a/include/clang/Rewrite/HTMLRewrite.h +++ b/include/clang/Rewrite/HTMLRewrite.h @@ -23,7 +23,6 @@ namespace clang { class Rewriter; class RewriteBuffer; class Preprocessor; -class PreprocessorFactory; namespace html { @@ -68,14 +67,14 @@ namespace html { /// SyntaxHighlight - Relex the specified FileID and annotate the HTML with /// information about keywords, comments, etc. - void SyntaxHighlight(Rewriter &R, FileID FID, Preprocessor &PP); + void SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP); /// HighlightMacros - This uses the macro table state from the end of the /// file, to reexpand macros and insert (into the HTML) information about the /// macro expansions. This won't be perfectly perfect, but it will be /// reasonably close. - void HighlightMacros(Rewriter &R, FileID FID, Preprocessor &PP); - void HighlightMacros(Rewriter &R, FileID FID, PreprocessorFactory &PPF); + void HighlightMacros(Rewriter &R, FileID FID, const Preprocessor &PP); + } // end html namespace } // end clang namespace -- cgit v1.1