From: Chris Lattner Date: Tue, 3 Feb 2009 21:52:55 +0000 (+0000) Subject: stub out basic #line handling calls. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c4ea17d7f991516c37a871dfa4bbe5723fa85f0;p=clang stub out basic #line handling calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63667 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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); }