]> granicus.if.org Git - clang/commitdiff
stub out basic #line handling calls.
authorChris Lattner <sabre@nondot.org>
Tue, 3 Feb 2009 21:52:55 +0000 (21:52 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 Feb 2009 21:52:55 +0000 (21:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63667 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceManager.h
lib/Basic/SourceManager.cpp
lib/Lex/PPDirectives.cpp

index ce2aeccb9044a96bc3b1249a8b0311ba4b3c12d7..a875f93c33a8863203bad4ffd630ec756c5dec86 100644 (file)
@@ -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.
index 6f78ee175c62f29d31a96e7c0532f53e227e4a49..ce9efb034a9375f7d1e692477c0e927e19285d25 100644 (file)
@@ -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.
 //===--------------------------------------------------------------------===//
index 1ff469b8258ec594ce04095e443b28c41fadd4ce..fa57ab3c81bc0f66f6e83b122ab97e94f48084b9 100644 (file)
@@ -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);
 }