summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-11 21:15:38 +0000
committerChris Lattner <sabre@nondot.org>2009-04-11 21:15:38 +0000
commitc523d8e88c94113717f12381cd44c2a3699e9d10 (patch)
treecbc3d2482d5af30206b31c3c264036a6a6825b36 /clang/lib/Frontend/PCHWriter.cpp
parent28d198177f0007d93add0189451279f957c54d7d (diff)
downloadbcm5719-llvm-c523d8e88c94113717f12381cd44c2a3699e9d10.tar.gz
bcm5719-llvm-c523d8e88c94113717f12381cd44c2a3699e9d10.zip
now that we have an identifier table in the PCH file, finish hooking up
macro deserialization. We now correctly install II's in tokens, handle function-like macros, etc. llvm-svn: 68882
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index c595fefca4a..6faf37fb295 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -582,17 +582,7 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
if (MI->isBuiltinMacro())
continue;
- 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);
+ AddIdentifierRef(I->first, Record);
Record.push_back(MI->getDefinitionLoc().getRawEncoding());
Record.push_back(MI->isUsed());
@@ -607,8 +597,7 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
Record.push_back(MI->getNumArgs());
for (MacroInfo::arg_iterator I = MI->arg_begin(), E = MI->arg_end();
I != E; ++I)
- // FIXME: Output the identifier Info ID #!
- Record.push_back((intptr_t)II);
+ AddIdentifierRef(*I, Record);
}
S.EmitRecord(Code, Record);
Record.clear();
@@ -623,10 +612,9 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
Record.push_back(Tok.getLocation().getRawEncoding());
Record.push_back(Tok.getLength());
- // FIXME: Output the identifier Info ID #!
// FIXME: When reading literal tokens, reconstruct the literal pointer if
// it is needed.
- Record.push_back((intptr_t)Tok.getIdentifierInfo());
+ AddIdentifierRef(Tok.getIdentifierInfo(), Record);
// FIXME: Should translate token kind to a stable encoding.
Record.push_back(Tok.getKind());
OpenPOWER on IntegriCloud