aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2008-08-10 19:59:06 +0000
committerNico Weber <nicolasweber@gmx.de>2008-08-10 19:59:06 +0000
commit4c3116437cc19d05b3031b8e99566ef47bf463e8 (patch)
treea6f8b9aed87ba5053d4400387feaf2970bbae916 /clang/lib/Basic/SourceManager.cpp
parentcb1e06e8fda6d896c7b3031c220fb10e45b30049 (diff)
downloadllvm-4c3116437cc19d05b3031b8e99566ef47bf463e8.zip
llvm-4c3116437cc19d05b3031b8e99566ef47bf463e8.tar.gz
llvm-4c3116437cc19d05b3031b8e99566ef47bf463e8.tar.bz2
* Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed llvm-svn: 54620
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index d7d2c84..7534ac4 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -75,14 +75,15 @@ SourceManager::createMemBufferContentCache(const MemoryBuffer *Buffer) {
/// include position. This works regardless of whether the ContentCache
/// corresponds to a file or some other input source.
unsigned SourceManager::createFileID(const ContentCache *File,
- SourceLocation IncludePos) {
+ SourceLocation IncludePos,
+ bool isSysHeader) {
// 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));
+ FileIDs.push_back(FileIDInfo::get(IncludePos, 0, File, isSysHeader));
assert(FileIDs.size() < (1 << SourceLocation::FileIDBits) &&
"Ran out of file ID's!");
return FileIDs.size();
@@ -93,7 +94,8 @@ unsigned SourceManager::createFileID(const ContentCache *File,
unsigned ChunkNo = 0;
while (1) {
- FileIDs.push_back(FileIDInfo::get(IncludePos, ChunkNo++, File));
+ FileIDs.push_back(FileIDInfo::get(IncludePos, ChunkNo++, File,
+ isSysHeader));
if (FileSize+1 < (1 << SourceLocation::FilePosBits)) break;
FileSize -= (1 << SourceLocation::FilePosBits);