diff options
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 12 | ||||
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 2cc29ecbed8..ddea8e52a02 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -377,14 +377,20 @@ LookupSubframeworkHeader(const char *FilenameStart, //===----------------------------------------------------------------------===// -/// getFileInfo - Return the PerFileInfo structure for the specified +/// getFileInfo - Return the HeaderFileInfo structure for the specified /// FileEntry. -HeaderSearch::PerFileInfo &HeaderSearch::getFileInfo(const FileEntry *FE) { +HeaderFileInfo &HeaderSearch::getFileInfo(const FileEntry *FE) { if (FE->getUID() >= FileInfo.size()) FileInfo.resize(FE->getUID()+1); return FileInfo[FE->getUID()]; } +void HeaderSearch::setHeaderFileInfoForUID(HeaderFileInfo HFI, unsigned UID) { + if (UID >= FileInfo.size()) + FileInfo.resize(UID+1); + FileInfo[UID] = HFI; +} + /// ShouldEnterIncludeFile - Mark the specified file as a target of of a /// #include, #include_next, or #import directive. Return false if #including /// the file will have no effect or true if we should include it. @@ -392,7 +398,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(const FileEntry *File, bool isImport){ ++NumIncluded; // Count # of attempted #includes. // Get information about this file. - PerFileInfo &FileInfo = getFileInfo(File); + HeaderFileInfo &FileInfo = getFileInfo(File); // If this is a #import directive, check that we have not already imported // this header. diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index 6f61c6516b3..2a05ba336fc 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/lib/Lex/PPLexerChange.cpp @@ -179,7 +179,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { if (CurPPLexer) { // Not ending a macro, ignore it. if (const IdentifierInfo *ControllingMacro = CurPPLexer->MIOpt.GetControllingMacroAtEndOfFile()) { - // Okay, this has a controlling macro, remember in PerFileInfo. + // Okay, this has a controlling macro, remember in HeaderFileInfo. if (const FileEntry *FE = SourceMgr.getFileEntryForID(CurPPLexer->getFileID())) HeaderInfo.SetFileControllingMacro(FE, ControllingMacro); |