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 | 721818304ac462d8c6ce05eecd02884033db78f1 (patch) | |
tree | a71956e82aa61337bbefcc15fc7bb8df83a73bf4 /lib/Basic/SourceManager.cpp | |
parent | 1b9ad143c163a8e18f8dc34e8cdabfa668a53aea (diff) | |
download | clang-721818304ac462d8c6ce05eecd02884033db78f1.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 7534ac4f26..66a85146a1 100644 --- a/lib/Basic/SourceManager.cpp +++ b/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); |