From: Douglas Gregor Date: Wed, 15 Apr 2009 18:43:11 +0000 (+0000) Subject: PCH support for the string literal of a FileScopeAsmDecl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a2bfb2ead4489db37e80b696a6d7cc073c76fd7;p=clang PCH support for the string literal of a FileScopeAsmDecl. Some minor cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 5a01aee8b8..983c2b8807 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -188,7 +188,7 @@ void PCHDeclReader::VisitOriginalParmVarDecl(OriginalParmVarDecl *PD) { void PCHDeclReader::VisitFileScopeAsmDecl(FileScopeAsmDecl *AD) { VisitDecl(AD); - // FIXME: read asm string + AD->setAsmString(cast(Reader.ReadExpr())); } void PCHDeclReader::VisitBlockDecl(BlockDecl *BD) { @@ -593,6 +593,7 @@ PCHReader::PCHReadResult PCHReader::ReadSourceManagerBlock() { Record.clear(); unsigned RecCode = Stream.ReadRecord(Code, Record, &BlobStart, &BlobLen); assert(RecCode == pch::SM_SLOC_BUFFER_BLOB && "Ill-formed PCH file"); + (void)RecCode; llvm::MemoryBuffer *Buffer = llvm::MemoryBuffer::getMemBuffer(BlobStart, BlobStart + BlobLen - 1, @@ -1471,6 +1472,7 @@ bool PCHReader::ReadDeclsLexicallyInContext(DeclContext *DC, RecordData Record; unsigned Code = Stream.ReadCode(); unsigned RecCode = Stream.ReadRecord(Code, Record); + (void)RecCode; assert(RecCode == pch::DECL_CONTEXT_LEXICAL && "Expected lexical block"); // Load all of the declaration IDs @@ -1496,6 +1498,7 @@ bool PCHReader::ReadDeclsVisibleInContext(DeclContext *DC, RecordData Record; unsigned Code = Stream.ReadCode(); unsigned RecCode = Stream.ReadRecord(Code, Record); + (void)RecCode; assert(RecCode == pch::DECL_CONTEXT_VISIBLE && "Expected visible block"); if (Record.size() == 0) return false; diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 0b5a2a65d1..46db1428e3 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -194,12 +194,12 @@ void PCHTypeWriter::VisitEnumType(const EnumType *T) { void PCHTypeWriter::VisitTemplateSpecializationType( const TemplateSpecializationType *T) { - // FIXME: Serialize this type + // FIXME: Serialize this type (C++ only) assert(false && "Cannot serialize template specialization types"); } void PCHTypeWriter::VisitQualifiedNameType(const QualifiedNameType *T) { - // FIXME: Serialize this type + // FIXME: Serialize this type (C++ only) assert(false && "Cannot serialize qualified name types"); } @@ -381,7 +381,7 @@ void PCHDeclWriter::VisitVarDecl(VarDecl *D) { void PCHDeclWriter::VisitParmVarDecl(ParmVarDecl *D) { VisitVarDecl(D); Record.push_back(D->getObjCDeclQualifier()); // FIXME: stable encoding - // FIXME: emit default argument + // FIXME: emit default argument (C++) // FIXME: why isn't the "default argument" just stored as the initializer // in VarDecl? Code = pch::DECL_PARM_VAR; @@ -395,7 +395,7 @@ void PCHDeclWriter::VisitOriginalParmVarDecl(OriginalParmVarDecl *D) { void PCHDeclWriter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { VisitDecl(D); - // FIXME: Emit the string literal + Writer.AddExpr(D->getAsmString()); Code = pch::DECL_FILE_SCOPE_ASM; }