summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-13 01:29:17 +0000
committerChris Lattner <sabre@nondot.org>2009-04-13 01:29:17 +0000
commit0af3ba17486de80987f8f22f5d418cef781a471c (patch)
treeb8fa061796bbaae27e8510974f1fbe5924ff483b /clang/lib/Frontend/PCHWriter.cpp
parent0d6c061401d9b06cbcdc1cb3511d3b5332cee3d8 (diff)
downloadbcm5719-llvm-0af3ba17486de80987f8f22f5d418cef781a471c.tar.gz
bcm5719-llvm-0af3ba17486de80987f8f22f5d418cef781a471c.zip
implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
llvm-svn: 68933
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index 6faf37fb295..2cf932ce9b6 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -567,6 +567,13 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
RecordData Record;
+ // If the preprocessor __COUNTER__ value has been bumped, remember it.
+ if (PP.getCounterValue() != 0) {
+ Record.push_back(PP.getCounterValue());
+ S.EmitRecord(pch::PP_COUNTER_VALUE, Record);
+ Record.clear();
+ }
+
// Loop over all the macro definitions that are live at the end of the file,
// emitting each to the PP section.
// FIXME: Eventually we want to emit an index so that we can lazily load
@@ -627,9 +634,6 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
}
- // TODO: someday when PP supports __COUNTER__, emit a record for its value if
- // non-zero.
-
S.ExitBlock();
}
OpenPOWER on IntegriCloud