diff options
author | Chris Lattner <sabre@nondot.org> | 2008-09-26 20:12:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-09-26 20:12:23 +0000 |
commit | c88a23e8d7a85b002789794ca83eb9da81eae7de (patch) | |
tree | f86c320616e57db7cc0d6b1f51bffc2d81a5f9db /clang/lib/Basic/SourceManager.cpp | |
parent | 71efd8159eb41cb53f21385b56c7f6ec73456956 (diff) | |
download | bcm5719-llvm-c88a23e8d7a85b002789794ca83eb9da81eae7de.tar.gz bcm5719-llvm-c88a23e8d7a85b002789794ca83eb9da81eae7de.zip |
Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfo
to whether the fileid is a 'extern c system header' in addition to whether it
is a system header, most of this is spreading plumbing around. Once we have that,
PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to
base the system header state on FileIDInfo instead of HeaderSearch. Finally,
in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness
of a file being entered can be set due to the #includer or the #includee.
llvm-svn: 56688
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 7534ac4f267..66a85146a10 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -76,14 +76,14 @@ SourceManager::createMemBufferContentCache(const MemoryBuffer *Buffer) { /// corresponds to a file or some other input source. unsigned SourceManager::createFileID(const ContentCache *File, SourceLocation IncludePos, - bool isSysHeader) { + unsigned DirCharacter) { // If FileEnt is really large (e.g. it's a large .i file), we may not be able // to fit an arbitrary position in the file in the FilePos field. To handle // this, we create one FileID for each chunk of the file that fits in a // FilePos field. unsigned FileSize = File->Buffer->getBufferSize(); if (FileSize+1 < (1 << SourceLocation::FilePosBits)) { - FileIDs.push_back(FileIDInfo::get(IncludePos, 0, File, isSysHeader)); + FileIDs.push_back(FileIDInfo::get(IncludePos, 0, File, DirCharacter)); assert(FileIDs.size() < (1 << SourceLocation::FileIDBits) && "Ran out of file ID's!"); return FileIDs.size(); @@ -95,7 +95,7 @@ unsigned SourceManager::createFileID(const ContentCache *File, unsigned ChunkNo = 0; while (1) { FileIDs.push_back(FileIDInfo::get(IncludePos, ChunkNo++, File, - isSysHeader)); + DirCharacter)); if (FileSize+1 < (1 << SourceLocation::FilePosBits)) break; FileSize -= (1 << SourceLocation::FilePosBits); |