From ecac99cbb4fc1411a821718d6c254333641c1198 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 22 May 2017 21:42:58 +0000 Subject: Give files from #line the characteristics of the current file This allows #line directives to appear in system headers that have code that clang would normally warn on. This is compatible with GCC, which is easy to test by running `gcc -E`. Fixes PR30752 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303582 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceManager.h | 3 +-- include/clang/Basic/SourceManagerInternals.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'include') diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 6960ea690b..eda8029340 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -1399,10 +1399,9 @@ public: /// specified by Loc. /// /// If FilenameID is -1, it is considered to be unspecified. - void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID); void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID, bool IsFileEntry, bool IsFileExit, - bool IsSystemHeader, bool IsExternCHeader); + SrcMgr::CharacteristicKind FileKind); /// \brief Determine if the source manager has a line table. bool hasLineTable() const { return LineTable != nullptr; } diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h index e65c97b003..9403dea888 100644 --- a/include/clang/Basic/SourceManagerInternals.h +++ b/include/clang/Basic/SourceManagerInternals.h @@ -101,8 +101,6 @@ public: } unsigned getNumFilenames() const { return FilenamesByID.size(); } - void AddLineNote(FileID FID, unsigned Offset, - unsigned LineNo, int FilenameID); void AddLineNote(FileID FID, unsigned Offset, unsigned LineNo, int FilenameID, unsigned EntryExit, SrcMgr::CharacteristicKind FileKind); -- cgit v1.2.3