diff options
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTConsumers.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 6 | ||||
-rw-r--r-- | include/clang/Frontend/CommandLineSourceLoc.h | 14 | ||||
-rw-r--r-- | include/clang/Frontend/CompileOptions.h | 2 | ||||
-rw-r--r-- | include/clang/Frontend/DocumentXML.h | 59 | ||||
-rw-r--r-- | include/clang/Frontend/FixItRewriter.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/FrontendDiagnostic.h | 2 | ||||
-rw-r--r-- | include/clang/Frontend/ManagerRegistry.h | 2 | ||||
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 34 | ||||
-rw-r--r-- | include/clang/Frontend/PCHReader.h | 112 | ||||
-rw-r--r-- | include/clang/Frontend/PCHWriter.h | 24 | ||||
-rw-r--r-- | include/clang/Frontend/PathDiagnosticClients.h | 8 | ||||
-rw-r--r-- | include/clang/Frontend/TextDiagnosticPrinter.h | 8 | ||||
-rw-r--r-- | include/clang/Frontend/Utils.h | 2 |
14 files changed, 136 insertions, 145 deletions
diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h index d3d43c2588..fc89e95cd7 100644 --- a/include/clang/Frontend/ASTConsumers.h +++ b/include/clang/Frontend/ASTConsumers.h @@ -38,9 +38,9 @@ class LangOptions; // implementation is still incomplete. ASTConsumer *CreateASTPrinter(llvm::raw_ostream *OS); -// AST XML-printer: prints out the AST in a XML format +// AST XML-printer: prints out the AST in a XML format // The output is intended to be in a format such that -// clang or any other tool could re-parse the output back into the same AST, +// clang or any other tool could re-parse the output back into the same AST, // but the implementation is still incomplete. ASTConsumer *CreateASTPrinterXML(llvm::raw_ostream *OS); diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index d41549ec3e..3b72c37bcd 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -43,7 +43,7 @@ class ASTUnit { ASTUnit(const ASTUnit&); // do not implement ASTUnit &operator=(const ASTUnit &); // do not implement ASTUnit(); - + public: ~ASTUnit(); @@ -52,13 +52,13 @@ public: const Preprocessor &getPreprocessor() const { return *PP.get(); } Preprocessor &getPreprocessor() { return *PP.get(); } - + const ASTContext &getASTContext() const { return *Ctx.get(); } ASTContext &getASTContext() { return *Ctx.get(); } const Diagnostic &getDiagnostic() const { return *Diags.get(); } Diagnostic &getDiagnostic() { return *Diags.get(); } - + FileManager &getFileManager(); const std::string &getOriginalSourceFileName(); diff --git a/include/clang/Frontend/CommandLineSourceLoc.h b/include/clang/Frontend/CommandLineSourceLoc.h index 1eaa958995..4092724372 100644 --- a/include/clang/Frontend/CommandLineSourceLoc.h +++ b/include/clang/Frontend/CommandLineSourceLoc.h @@ -34,21 +34,21 @@ namespace llvm { /// /// Source locations are of the form filename:line:column. template<> - class parser<clang::ParsedSourceLocation> + class parser<clang::ParsedSourceLocation> : public basic_parser<clang::ParsedSourceLocation> { public: - bool parse(Option &O, const char *ArgName, + bool parse(Option &O, const char *ArgName, const std::string &ArgValue, clang::ParsedSourceLocation &Val); }; - bool + bool parser<clang::ParsedSourceLocation>:: - parse(Option &O, const char *ArgName, const std::string &ArgValue, + parse(Option &O, const char *ArgName, const std::string &ArgValue, clang::ParsedSourceLocation &Val) { using namespace clang; - const char *ExpectedFormat + const char *ExpectedFormat = "source location must be of the form filename:line:column"; std::string::size_type SecondColon = ArgValue.rfind(':'); if (SecondColon == std::string::npos) { @@ -56,7 +56,7 @@ namespace llvm { return true; } char *EndPtr; - long Column + long Column = std::strtol(ArgValue.c_str() + SecondColon + 1, &EndPtr, 10); if (EndPtr != ArgValue.c_str() + ArgValue.size()) { std::fprintf(stderr, "%s\n", ExpectedFormat); @@ -73,7 +73,7 @@ namespace llvm { std::fprintf(stderr, "%s\n", ExpectedFormat); return true; } - + Val.FileName = ArgValue.substr(0, FirstColon); Val.Line = Line; Val.Column = Column; diff --git a/include/clang/Frontend/CompileOptions.h b/include/clang/Frontend/CompileOptions.h index 75dec00f74..508af537b1 100644 --- a/include/clang/Frontend/CompileOptions.h +++ b/include/clang/Frontend/CompileOptions.h @@ -67,7 +67,7 @@ public: Inlining = NoInlining; DisableRedZone = 0; NoImplicitFloat = 0; - } + } }; } // end namespace clang diff --git a/include/clang/Frontend/DocumentXML.h b/include/clang/Frontend/DocumentXML.h index 4ed11e153c..31cffd0be9 100644 --- a/include/clang/Frontend/DocumentXML.h +++ b/include/clang/Frontend/DocumentXML.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements the XML document class, which provides the means to +// This file implements the XML document class, which provides the means to // dump out the AST in a XML form that exposes type details and other fields. // //===----------------------------------------------------------------------===// @@ -32,10 +32,9 @@ class NamedDecl; class FunctionDecl; class ASTContext; class LabelStmt; - -//--------------------------------------------------------- -namespace XML -{ + +//--------------------------------------------------------- +namespace XML { // id maps: template<class T> struct IdMap : llvm::DenseMap<T, unsigned> {}; @@ -47,9 +46,8 @@ namespace XML struct IdMap<std::string> : std::map<std::string, unsigned> {}; } -//--------------------------------------------------------- -class DocumentXML -{ +//--------------------------------------------------------- +class DocumentXML { public: DocumentXML(const std::string& rootName, llvm::raw_ostream& out); @@ -62,24 +60,22 @@ public: DocumentXML& addSubNode(const std::string& name); // also enters the sub node, returns *this DocumentXML& toParent(); // returns *this - void addAttribute(const char* pName, const QualType& pType); + void addAttribute(const char* pName, const QualType& pType); void addAttribute(const char* pName, bool value); template<class T> - void addAttribute(const char* pName, const T* value) - { + void addAttribute(const char* pName, const T* value) { addPtrAttribute(pName, value); } template<class T> - void addAttribute(const char* pName, T* value) - { + void addAttribute(const char* pName, T* value) { addPtrAttribute(pName, value); } template<class T> void addAttribute(const char* pName, const T& value); - + template<class T> void addAttributeOptional(const char* pName, const T& value); @@ -114,7 +110,7 @@ private: void Indent(); // forced pointer dispatch: - void addPtrAttribute(const char* pName, const Type* pType); + void addPtrAttribute(const char* pName, const Type* pType); void addPtrAttribute(const char* pName, const NamedDecl* D); void addPtrAttribute(const char* pName, const DeclContext* D); void addPtrAttribute(const char* pName, const NamespaceDecl* D); // disambiguation @@ -141,42 +137,37 @@ private: //--------------------------------------------------------- inlines -inline void DocumentXML::initialize(ASTContext &Context) -{ - Ctx = &Context; +inline void DocumentXML::initialize(ASTContext &Context) { + Ctx = &Context; } -//--------------------------------------------------------- +//--------------------------------------------------------- template<class T> -inline void DocumentXML::addAttribute(const char* pName, const T& value) -{ +inline void DocumentXML::addAttribute(const char* pName, const T& value) { Out << ' ' << pName << "=\"" << value << "\""; } -//--------------------------------------------------------- -inline void DocumentXML::addPtrAttribute(const char* pName, const char* text) -{ +//--------------------------------------------------------- +inline void DocumentXML::addPtrAttribute(const char* pName, const char* text) { Out << ' ' << pName << "=\"" << text << "\""; } -//--------------------------------------------------------- -inline void DocumentXML::addAttribute(const char* pName, bool value) -{ +//--------------------------------------------------------- +inline void DocumentXML::addAttribute(const char* pName, bool value) { addPtrAttribute(pName, value ? "1" : "0"); } -//--------------------------------------------------------- +//--------------------------------------------------------- template<class T> -inline void DocumentXML::addAttributeOptional(const char* pName, const T& value) -{ - if (!isDefault(value)) - { +inline void DocumentXML::addAttributeOptional(const char* pName, + const T& value) { + if (!isDefault(value)) { addAttribute(pName, value); } } -//--------------------------------------------------------- +//--------------------------------------------------------- -} //namespace clang +} //namespace clang #endif //LLVM_CLANG_DOCUMENTXML_H diff --git a/include/clang/Frontend/FixItRewriter.h b/include/clang/Frontend/FixItRewriter.h index 7fcd682bf6..fac87afade 100644 --- a/include/clang/Frontend/FixItRewriter.h +++ b/include/clang/Frontend/FixItRewriter.h @@ -51,7 +51,7 @@ class FixItRewriter : public DiagnosticClient { unsigned NumFailures; /// \brief Locations at which we should perform fix-its. - /// + /// /// When empty, perform fix-it modifications everywhere. llvm::SmallVector<RequestedSourceLocation, 4> FixItLocations; @@ -72,7 +72,7 @@ public: /// \brief Write the modified source file. /// /// \returns true if there was an error, false otherwise. - bool WriteFixedFile(const std::string &InFileName, + bool WriteFixedFile(const std::string &InFileName, const std::string &OutFileName = std::string()); /// IncludeInDiagnosticCounts - This method (whose default implementation diff --git a/include/clang/Frontend/FrontendDiagnostic.h b/include/clang/Frontend/FrontendDiagnostic.h index 079abae3ee..a044586a8c 100644 --- a/include/clang/Frontend/FrontendDiagnostic.h +++ b/include/clang/Frontend/FrontendDiagnostic.h @@ -13,7 +13,7 @@ #include "clang/Basic/Diagnostic.h" namespace clang { - namespace diag { + namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM, #define FRONTENDSTART diff --git a/include/clang/Frontend/ManagerRegistry.h b/include/clang/Frontend/ManagerRegistry.h index ecab67a3b6..f05cfe6df6 100644 --- a/include/clang/Frontend/ManagerRegistry.h +++ b/include/clang/Frontend/ManagerRegistry.h @@ -43,7 +43,7 @@ public: class RegisterConstraintManager { public: RegisterConstraintManager(ConstraintManagerCreator CMC) { - assert(ManagerRegistry::ConstraintMgrCreator == 0 + assert(ManagerRegistry::ConstraintMgrCreator == 0 && "ConstraintMgrCreator already set!"); ManagerRegistry::ConstraintMgrCreator = CMC; } diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index 92a541ea19..f6efccfe07 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -65,7 +65,7 @@ namespace clang { typedef uint32_t IdentID; typedef uint32_t SelectorID; - + /// \brief Describes the various kinds of blocks that occur within /// a PCH file. enum BlockIDs { @@ -106,7 +106,7 @@ namespace clang { /// TYPE_OFFSET block to determine the offset of that type's /// corresponding record within the TYPES_BLOCK_ID block. TYPE_OFFSET = 1, - + /// \brief Record code for the offsets of each decl. /// /// The DECL_OFFSET constant describes the record that occurs @@ -182,7 +182,7 @@ namespace clang { /// \brief Record code for the array of locally-scoped external /// declarations. LOCALLY_SCOPED_EXTERNAL_DECLS = 11, - + /// \brief Record code for the table of offsets into the /// Objective-C method pool. SELECTOR_OFFSETS = 12, @@ -215,7 +215,7 @@ namespace clang { /// \brief Record code for the original file that was used to /// generate the precompiled header. ORIGINAL_FILE_NAME = 19, - + /// \brief Record code for the sorted array of source ranges where /// comments were encountered in the source code. COMMENT_RANGES = 20 @@ -243,7 +243,7 @@ namespace clang { /// ControllingMacro is optional. SM_HEADER_FILE_INFO = 6 }; - + /// \brief Record types used within a preprocessor block. enum PreprocessorRecordTypes { // The macros in the PP section are a PP_MACRO_* instance followed by a @@ -257,7 +257,7 @@ namespace clang { /// [PP_MACRO_FUNCTION_LIKE, <ObjectLikeStuff>, IsC99Varargs, IsGNUVarars, /// NumArgs, ArgIdentInfoID* ] PP_MACRO_FUNCTION_LIKE = 2, - + /// \brief Describes one token. /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags] PP_TOKEN = 3 @@ -333,7 +333,7 @@ namespace clang { /// \brief The ObjC 'id' type. PREDEF_TYPE_OBJC_ID = 26, /// \brief The ObjC 'Class' type. - PREDEF_TYPE_OBJC_CLASS = 27 + PREDEF_TYPE_OBJC_CLASS = 27 }; /// \brief The number of predefined type IDs that are reserved for @@ -627,9 +627,9 @@ namespace clang { EXPR_BLOCK, /// \brief A BlockDeclRef record. EXPR_BLOCK_DECL_REF, - + // Objective-C - + /// \brief An ObjCStringLiteral record. EXPR_OBJC_STRING_LITERAL, /// \brief An ObjCEncodeExpr record. @@ -650,23 +650,23 @@ namespace clang { EXPR_OBJC_SUPER_EXPR, /// \brief An ObjCIsa Expr record. EXPR_OBJC_ISA, - - /// \brief An ObjCForCollectionStmt record. + + /// \brief An ObjCForCollectionStmt record. STMT_OBJC_FOR_COLLECTION, - /// \brief An ObjCAtCatchStmt record. + /// \brief An ObjCAtCatchStmt record. STMT_OBJC_CATCH, - /// \brief An ObjCAtFinallyStmt record. + /// \brief An ObjCAtFinallyStmt record. STMT_OBJC_FINALLY, - /// \brief An ObjCAtTryStmt record. + /// \brief An ObjCAtTryStmt record. STMT_OBJC_AT_TRY, - /// \brief An ObjCAtSynchronizedStmt record. + /// \brief An ObjCAtSynchronizedStmt record. STMT_OBJC_AT_SYNCHRONIZED, - /// \brief An ObjCAtThrowStmt record. + /// \brief An ObjCAtThrowStmt record. STMT_OBJC_AT_THROW, // C++ - /// \brief An CXXOperatorCallExpr record. + /// \brief An CXXOperatorCallExpr record. EXPR_CXX_OPERATOR_CALL }; diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h index 2ddf13fcf1..6f28a25722 100644 --- a/include/clang/Frontend/PCHReader.h +++ b/include/clang/Frontend/PCHReader.h @@ -66,21 +66,21 @@ struct HeaderFileInfo; class PCHReaderListener { public: virtual ~PCHReaderListener(); - + /// \brief Receives the language options. /// /// \returns true to indicate the options are invalid or false otherwise. virtual bool ReadLanguageOptions(const LangOptions &LangOpts) { return false; } - + /// \brief Receives the target triple. /// /// \returns true to indicate the target triple is invalid or false otherwise. virtual bool ReadTargetTriple(const std::string &Triple) { return false; } - + /// \brief Receives the contents of the predefines buffer. /// /// \param PCHPredef The start of the predefines buffer in the PCH @@ -95,16 +95,16 @@ public: /// here. /// /// \returns true to indicate the predefines are invalid or false otherwise. - virtual bool ReadPredefinesBuffer(const char *PCHPredef, + virtual bool ReadPredefinesBuffer(const char *PCHPredef, unsigned PCHPredefLen, FileID PCHBufferID, std::string &SuggestedPredefines) { return false; } - + /// \brief Receives a HeaderFileInfo entry. virtual void ReadHeaderFileInfo(const HeaderFileInfo &HFI) {} - + /// \brief Receives __COUNTER__ value. virtual void ReadCounter(unsigned Value) {} }; @@ -114,16 +114,16 @@ public: class PCHValidator : public PCHReaderListener { Preprocessor &PP; PCHReader &Reader; - + unsigned NumHeaderInfos; - + public: PCHValidator(Preprocessor &PP, PCHReader &Reader) : PP(PP), Reader(Reader), NumHeaderInfos(0) {} - + virtual bool ReadLanguageOptions(const LangOptions &LangOpts); virtual bool ReadTargetTriple(const std::string &Triple); - virtual bool ReadPredefinesBuffer(const char *PCHPredef, + virtual bool ReadPredefinesBuffer(const char *PCHPredef, unsigned PCHPredefLen, FileID PCHBufferID, std::string &SuggestedPredefines); @@ -143,8 +143,8 @@ public: /// The PCH reader provides lazy de-serialization of declarations, as /// required when traversing the AST. Only those AST nodes that are /// actually required will be de-serialized. -class PCHReader - : public ExternalSemaSource, +class PCHReader + : public ExternalSemaSource, public IdentifierInfoLookup, public ExternalIdentifierLookup, public ExternalSLocEntrySource { @@ -154,11 +154,11 @@ public: private: /// \ brief The receiver of some callbacks invoked by PCHReader. llvm::OwningPtr<PCHReaderListener> Listener; - + SourceManager &SourceMgr; FileManager &FileMgr; Diagnostic &Diags; - + /// \brief The semantic analysis object that will be processing the /// PCH file and the translation unit that uses it. Sema *SemaObj; @@ -203,8 +203,8 @@ private: const uint32_t *TypeOffsets; /// \brief Types that have already been loaded from the PCH file. - /// - /// When the pointer at index I is non-NULL, the type with + /// + /// When the pointer at index I is non-NULL, the type with /// ID = (I + 1) << 3 has already been loaded from the PCH file. std::vector<Type *> TypesLoaded; @@ -273,7 +273,7 @@ private: /// \brief The total number of selectors stored in the PCH file. unsigned TotalNumSelectors; - /// \brief A vector containing selectors that have already been loaded. + /// \brief A vector containing selectors that have already been loaded. /// /// This vector is indexed by the Selector ID (-1). NULL selector /// entries indicate that the particular selector ID has not yet @@ -282,10 +282,10 @@ private: /// \brief A sorted array of source ranges containing comments. SourceRange *Comments; - + /// \brief The number of source ranges in the Comments array. unsigned NumComments; - + /// \brief The set of external definitions stored in the the PCH /// file. llvm::SmallVector<uint64_t, 16> ExternalDefinitions; @@ -312,11 +312,11 @@ private: /// \brief Whether this precompiled header is a relocatable PCH file. bool RelocatablePCH; - - /// \brief The system include root to be used when loading the + + /// \brief The system include root to be used when loading the /// precompiled header. const char *isysroot; - + /// \brief Mapping from switch-case IDs in the PCH file to /// switch-case statements. std::map<unsigned, SwitchCase *> SwitchCaseStmts; @@ -369,41 +369,41 @@ private: /// Number of visible decl contexts read/total. unsigned NumVisibleDeclContextsRead, TotalVisibleDeclContexts; - - /// \brief When a type or declaration is being loaded from the PCH file, an - /// instantance of this RAII object will be available on the stack to + + /// \brief When a type or declaration is being loaded from the PCH file, an + /// instantance of this RAII object will be available on the stack to /// indicate when we are in a recursive-loading situation. class LoadingTypeOrDecl { PCHReader &Reader; LoadingTypeOrDecl *Parent; - + LoadingTypeOrDecl(const LoadingTypeOrDecl&); // do not implement LoadingTypeOrDecl &operator=(const LoadingTypeOrDecl&); // do not implement - + public: explicit LoadingTypeOrDecl(PCHReader &Reader); ~LoadingTypeOrDecl(); }; friend class LoadingTypeOrDecl; - + /// \brief If we are currently loading a type or declaration, points to the /// most recent LoadingTypeOrDecl object on the stack. LoadingTypeOrDecl *CurrentlyLoadingTypeOrDecl; - - /// \brief An IdentifierInfo that has been loaded but whose top-level + + /// \brief An IdentifierInfo that has been loaded but whose top-level /// declarations of the same name have not (yet) been loaded. struct PendingIdentifierInfo { IdentifierInfo *II; llvm::SmallVector<uint32_t, 4> DeclIDs; }; - + /// \brief The set of identifiers that were read while the PCH reader was - /// (recursively) loading declarations. - /// + /// (recursively) loading declarations. + /// /// The declarations on the identifier chain for these identifiers will be /// loaded once the recursive loading has completed. std::deque<PendingIdentifierInfo> PendingIdentifierInfos; - + /// \brief FIXME: document! llvm::SmallVector<uint64_t, 4> SpecialTypes; @@ -434,17 +434,17 @@ private: /// there are differences that the PCH reader can work around, this /// predefines buffer may contain additional definitions. std::string SuggestedPredefines; - + void MaybeAddSystemRootToFilename(std::string &Filename); - + PCHReadResult ReadPCHBlock(); - bool CheckPredefinesBuffer(const char *PCHPredef, + bool CheckPredefinesBuffer(const char *PCHPredef, unsigned PCHPredefLen, FileID PCHBufferID); bool ParseLineTable(llvm::SmallVectorImpl<uint64_t> &Record); PCHReadResult ReadSourceManagerBlock(); PCHReadResult ReadSLocEntryRecord(unsigned ID); - + bool ParseLanguageOptions(const llvm::SmallVectorImpl<uint64_t> &Record); QualType ReadTypeRecord(uint64_t Offset); void LoadedDecl(unsigned Index, Decl *D); @@ -474,7 +474,7 @@ public: /// user. This is only used with relocatable PCH files. If non-NULL, /// a relocatable PCH file will use the default path "/". PCHReader(Preprocessor &PP, ASTContext *Context, const char *isysroot = 0); - + /// \brief Load the PCH file without using any pre-initialized Preprocessor. /// /// The necessary information to initialize a Preprocessor later can be @@ -492,28 +492,28 @@ public: /// \param isysroot If non-NULL, the system include path specified by the /// user. This is only used with relocatable PCH files. If non-NULL, /// a relocatable PCH file will use the default path "/". - PCHReader(SourceManager &SourceMgr, FileManager &FileMgr, + PCHReader(SourceManager &SourceMgr, FileManager &FileMgr, Diagnostic &Diags, const char *isysroot = 0); ~PCHReader(); /// \brief Load the precompiled header designated by the given file /// name. PCHReadResult ReadPCH(const std::string &FileName); - + /// \brief Set the PCH callbacks listener. void setListener(PCHReaderListener *listener) { Listener.reset(listener); } - + /// \brief Set the Preprocessor to use. void setPreprocessor(Preprocessor &pp) { PP = &pp; } - + /// \brief Sets and initializes the given Context. void InitializeContext(ASTContext &Context); - /// \brief Retrieve the name of the original source file name + /// \brief Retrieve the name of the original source file name const std::string &getOriginalSourceFile() { return OriginalFileName; } /// \brief Retrieve the name of the original source file name @@ -533,7 +533,7 @@ public: /// replaced with the sorted set of source ranges corresponding to /// comments in the source code. virtual void ReadComments(std::vector<SourceRange> &Comments); - + /// \brief Resolve a type ID into a type, potentially building a new /// type. virtual QualType GetType(pch::TypeID ID); @@ -619,14 +619,14 @@ public: /// /// \returns a pair of Objective-C methods lists containing the /// instance and factory methods, respectively, with this selector. - virtual std::pair<ObjCMethodList, ObjCMethodList> + virtual std::pair<ObjCMethodList, ObjCMethodList> ReadMethodPool(Selector Sel); void SetIdentifierInfo(unsigned ID, IdentifierInfo *II); - void SetGloballyVisibleDecls(IdentifierInfo *II, + void SetGloballyVisibleDecls(IdentifierInfo *II, const llvm::SmallVectorImpl<uint32_t> &DeclIDs, bool Nonrecursive = false); - + /// \brief Report a diagnostic. DiagnosticBuilder Diag(unsigned DiagID); @@ -634,11 +634,11 @@ public: DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID); IdentifierInfo *DecodeIdentifierInfo(unsigned Idx); - + IdentifierInfo *GetIdentifierInfo(const RecordData &Record, unsigned &Idx) { return DecodeIdentifierInfo(Record[Idx++]); } - + virtual IdentifierInfo *GetIdentifier(unsigned ID) { return DecodeIdentifierInfo(ID); } @@ -647,7 +647,7 @@ public: virtual void ReadSLocEntry(unsigned ID); Selector DecodeSelector(unsigned Idx); - + Selector GetSelector(const RecordData &Record, unsigned &Idx) { return DecodeSelector(Record[Idx++]); } @@ -670,13 +670,13 @@ public: /// \brief ReadDeclExpr - Reads an expression from the current decl cursor. Expr *ReadDeclExpr(); - + /// \brief ReadTypeExpr - Reads an expression from the current type cursor. Expr *ReadTypeExpr(); /// \brief Reads a statement from the specified cursor. Stmt *ReadStmt(llvm::BitstreamCursor &Cursor); - + /// \brief Read a statement from the current DeclCursor. Stmt *ReadDeclStmt() { return ReadStmt(DeclsCursor); @@ -741,16 +741,16 @@ public: struct SavedStreamPosition { explicit SavedStreamPosition(llvm::BitstreamCursor &Cursor) : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) { } - + ~SavedStreamPosition() { Cursor.JumpToBit(Offset); } - + private: llvm::BitstreamCursor &Cursor; uint64_t Offset; }; - + } // end namespace clang #endif diff --git a/include/clang/Frontend/PCHWriter.h b/include/clang/Frontend/PCHWriter.h index 3bab9b998b..22341fb9c5 100644 --- a/include/clang/Frontend/PCHWriter.h +++ b/include/clang/Frontend/PCHWriter.h @@ -98,21 +98,21 @@ private: /// discovery), starting at 1. An ID of zero refers to a NULL /// IdentifierInfo. llvm::DenseMap<const IdentifierInfo *, pch::IdentID> IdentifierIDs; - + /// \brief Offsets of each of the identifier IDs into the identifier /// table. std::vector<uint32_t> IdentifierOffsets; /// \brief Map that provides the ID numbers of each Selector. llvm::DenseMap<Selector, pch::SelectorID> SelectorIDs; - + /// \brief Offset of each selector within the method pool/selector /// table, indexed by the Selector ID (-1). std::vector<uint32_t> SelectorOffsets; /// \brief A vector of all Selectors (ordered by ID). std::vector<Selector> SelVector; - + /// \brief Offsets of each of the macro identifiers into the /// bitstream. /// @@ -141,7 +141,7 @@ private: /// \brief Mapping from SwitchCase statements to IDs. std::map<SwitchCase *, unsigned> SwitchCaseIDs; - + /// \brief Mapping from LabelStmt statements to IDs. std::map<LabelStmt *, unsigned> LabelIDs; @@ -163,7 +163,7 @@ private: void WriteMetadata(ASTContext &Context, const char *isysroot); void WriteLanguageOptions(const LangOptions &LangOpts); void WriteStatCache(MemorizeStatCalls &StatCalls, const char* isysroot); - void WriteSourceManagerBlock(SourceManager &SourceMgr, + void WriteSourceManagerBlock(SourceManager &SourceMgr, const Preprocessor &PP, const char* isysroot); void WritePreprocessor(const Preprocessor &PP); @@ -172,7 +172,7 @@ private: void WriteTypesBlock(ASTContext &Context); uint64_t WriteDeclContextLexicalBlock(ASTContext &Context, DeclContext *DC); uint64_t WriteDeclContextVisibleBlock(ASTContext &Context, DeclContext *DC); - + void WriteDeclsBlock(ASTContext &Context); void WriteMethodPool(Sema &SemaRef); void WriteIdentifierTable(Preprocessor &PP); @@ -180,12 +180,12 @@ private: unsigned ParmVarDeclAbbrev; void WriteDeclsBlockAbbrevs(); - + public: /// \brief Create a new precompiled header writer that outputs to /// the given bitstream. PCHWriter(llvm::BitstreamWriter &Stream); - + /// \brief Write a precompiled header for the given semantic analysis. /// /// \param SemaRef a reference to the semantic analysis object that processed @@ -194,9 +194,9 @@ public: /// \param StatCalls the object that cached all of the stat() calls made while /// searching for source files and headers. /// - /// \param isysroot if non-NULL, write a relocatable PCH file whose headers + /// \param isysroot if non-NULL, write a relocatable PCH file whose headers /// are relative to the given system root. - void WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, + void WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, const char* isysroot); /// \brief Emit a source location. @@ -216,7 +216,7 @@ public: /// \brief Emit a Selector (which is a smart pointer reference) void AddSelectorRef(const Selector, RecordData &Record); - + /// \brief Get the unique number used to refer to the given /// identifier. pch::IdentID getIdentifierRef(const IdentifierInfo *II); @@ -226,7 +226,7 @@ public: /// /// The identifier must refer to a macro. uint64_t getMacroOffset(const IdentifierInfo *II) { - assert(MacroOffsets.find(II) != MacroOffsets.end() && + assert(MacroOffsets.find(II) != MacroOffsets.end() && "Identifier does not name a macro"); return MacroOffsets[II]; } diff --git a/include/clang/Frontend/PathDiagnosticClients.h b/include/clang/Frontend/PathDiagnosticClients.h index 53dd32e93b..8cb6898d75 100644 --- a/include/clang/Frontend/PathDiagnosticClients.h +++ b/include/clang/Frontend/PathDiagnosticClients.h @@ -23,12 +23,12 @@ namespace clang { class PathDiagnosticClient; class Preprocessor; class PreprocessorFactory; - + class PathDiagnosticClientFactory { public: PathDiagnosticClientFactory() {} virtual ~PathDiagnosticClientFactory() {} - + virtual const char *getName() const = 0; virtual PathDiagnosticClient* @@ -39,12 +39,12 @@ PathDiagnosticClient* CreateHTMLDiagnosticClient(const std::string& prefix, Preprocessor* PP = 0, PreprocessorFactory* PPF = 0, llvm::SmallVectorImpl<std::string>* FilesMade = 0); - + PathDiagnosticClientFactory* CreateHTMLDiagnosticClientFactory(const std::string& prefix, Preprocessor* PP = 0, PreprocessorFactory* PPF = 0); - + PathDiagnosticClient* CreatePlistDiagnosticClient(const std::string& prefix, Preprocessor* PP, PreprocessorFactory* PPF, diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h index f8408bdbd7..0fd8d44f72 100644 --- a/include/clang/Frontend/TextDiagnosticPrinter.h +++ b/include/clang/Frontend/TextDiagnosticPrinter.h @@ -52,7 +52,7 @@ public: unsigned messageLength = 0, bool useColors = false) < |