aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-10 18:22:18 +0000
committerChris Lattner <sabre@nondot.org>2009-04-10 18:22:18 +0000
commitd14f27053c5d2a9140eed38b9d208b94e7f83b31 (patch)
treeb661dfa93a289e19c4fe54b5905b73fd2ef76579
parentfc3388dfddf760cf3484fd99de28e1eb53769554 (diff)
add a new PP_MACRO_NAME hack so that I can test object-like macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68803 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Frontend/PCHBitCodes.h3
-rw-r--r--lib/Frontend/PCHWriter.cpp7
2 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index a8257bf007..4e66d2938d 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -121,6 +121,9 @@ namespace clang {
// The macros in the PP section are a PP_MACRO_* instance followed by a
// list of PP_TOKEN instances for each token in the definition.
+ // FIXME: TEMP HACK UNTIL WE HAVE IDENTIFIER INFO IDs.
+ PP_MACRO_NAME = 4,
+
/// \brief An object-like macro definition.
/// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
PP_MACRO_OBJECT_LIKE = 1,
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 255ce8bf8d..6f4492bc8c 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -505,6 +505,13 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
IdentifierInfo *II = I->first;
+ // FIXME: Emit a PP_MACRO_NAME for testing. This should be removed when we
+ // have identifierinfo id's.
+ for (unsigned i = 0, e = II->getLength(); i != e; ++i)
+ Record.push_back(II->getName()[i]);
+ S.EmitRecord(pch::PP_MACRO_NAME, Record);
+ Record.clear();
+
// FIXME: Output the identifier Info ID #!
Record.push_back((intptr_t)II);
Record.push_back(MI->getDefinitionLoc().getRawEncoding());