diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-03 21:52:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-03 21:52:55 +0000 |
commit | 4c4ea17d7f991516c37a871dfa4bbe5723fa85f0 (patch) | |
tree | 74b5f0015e81fe5f86d547c693f288f5193ed17b | |
parent | 660af749c0ad54cf8f6db611f31f0fa4115e4fd8 (diff) |
stub out basic #line handling calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63667 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/SourceManager.h | 4 | ||||
-rw-r--r-- | lib/Basic/SourceManager.cpp | 9 | ||||
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index ce2aeccb90..a875f93c33 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -536,6 +536,10 @@ public: /// unsigned getLineTableFilenameID(const char *Ptr, unsigned Len); + /// AddLineNote - Add a line note to the line table for the FileID and offset + /// specified by Loc. If FilenameID is -1, it is considered to be + /// unspecified. + void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID); //===--------------------------------------------------------------------===// // Other miscellaneous methods. diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 6f78ee175c..ce9efb034a 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -114,6 +114,15 @@ unsigned SourceManager::getLineTableFilenameID(const char *Ptr, unsigned Len) { } +/// AddLineNote - Add a line note to the line table for the FileID and offset +/// specified by Loc. If FilenameID is -1, it is considered to be +/// unspecified. +void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, + int FilenameID) { + +} + + //===--------------------------------------------------------------------===// // Private 'Create' methods. //===--------------------------------------------------------------------===// diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 1ff469b825..fa57ab3c81 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -651,7 +651,7 @@ void Preprocessor::HandleLineDirective(Token &Tok) { CheckEndOfDirective("#line"); } - // FIXME: do something with the #line info. + SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID); } /// ReadLineMarkerFlags - Parse and validate any flags at the end of a GNU line @@ -762,10 +762,8 @@ void Preprocessor::HandleDigitDirective(Token &DigitTok) { return; } - // FIXME: do something with the #line info. - - - + // FIXME: do something with the #line flag info. + SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID); } |