summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-03 21:52:55 +0000
committerChris Lattner <sabre@nondot.org>2009-02-03 21:52:55 +0000
commit1eaa70a612aa748c214858bef25e3fb79dbcb5c8 (patch)
treef51eed6298617405f8075cc8f51ba68aa76a4d87
parente80f317886a1bed87acd0d6c663f5786fad88593 (diff)
downloadbcm5719-llvm-1eaa70a612aa748c214858bef25e3fb79dbcb5c8.tar.gz
bcm5719-llvm-1eaa70a612aa748c214858bef25e3fb79dbcb5c8.zip
stub out basic #line handling calls.
llvm-svn: 63667
-rw-r--r--clang/include/clang/Basic/SourceManager.h4
-rw-r--r--clang/lib/Basic/SourceManager.cpp9
-rw-r--r--clang/lib/Lex/PPDirectives.cpp8
3 files changed, 16 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h
index ce2aeccb904..a875f93c33a 100644
--- a/clang/include/clang/Basic/SourceManager.h
+++ b/clang/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/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 6f78ee175c6..ce9efb034a9 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/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/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 1ff469b8258..fa57ab3c81b 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud