summaryrefslogtreecommitdiffstats
path: root/clang/Driver/TextDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-11 22:57:35 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-11 22:57:35 +0000
commit89fbadd3be10a996ad533de23eba704c2a6befa6 (patch)
treefa89bed9aecaec44af7b6a9931d0ab1e0625d833 /clang/Driver/TextDiagnostics.cpp
parent4e56ed5fabcc8a6ad75d99fa99e9a4830732d071 (diff)
downloadbcm5719-llvm-89fbadd3be10a996ad533de23eba704c2a6befa6.tar.gz
bcm5719-llvm-89fbadd3be10a996ad533de23eba704c2a6befa6.zip
Modified the internals of Diagnostic and DiagnosticClient to use
SourceManager*'s instead of SourceManager&'s. This allows the client specify a NULL SourceManager when using a default constructed SourceLocation. Thus the SourceManager can be NULL when the SourceLocation's isValid() == false. The interface to most clients of Diagnostic remains the same. Diagnostic::Report() is overload to either accept a SourceLocation and a SourceManager&, or neither. Thus clients that do not have a SourceManager cannot specify a SourceLocation. Modified TextDiagnostics* to use this new interface. Modified the driver to not passed in SourceManager when warning about "-I-". llvm-svn: 44887
Diffstat (limited to 'clang/Driver/TextDiagnostics.cpp')
-rw-r--r--clang/Driver/TextDiagnostics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/Driver/TextDiagnostics.cpp b/clang/Driver/TextDiagnostics.cpp
index 46e535de903..052ea6b98d1 100644
--- a/clang/Driver/TextDiagnostics.cpp
+++ b/clang/Driver/TextDiagnostics.cpp
@@ -41,12 +41,12 @@ std::string TextDiagnostics::FormatDiagnostic(Diagnostic &Diags,
bool TextDiagnostics::IgnoreDiagnostic(Diagnostic::Level Level,
SourceLocation Pos,
- SourceManager& SourceMgr) {
+ SourceManager* SourceMgr) {
if (Pos.isValid()) {
// If this is a warning or note, and if it a system header, suppress the
// diagnostic.
if (Level == Diagnostic::Warning || Level == Diagnostic::Note) {
- if (const FileEntry *F = SourceMgr.getFileEntryForLoc(Pos)) {
+ if (const FileEntry *F = SourceMgr->getFileEntryForLoc(Pos)) {
DirectoryLookup::DirType DirInfo = TheHeaderSearch->getFileDirFlavor(F);
if (DirInfo == DirectoryLookup::SystemHeaderDir ||
DirInfo == DirectoryLookup::ExternCSystemHeaderDir)
OpenPOWER on IntegriCloud