[cfe-commits] r69196 - in /cfe/trunk/lib/Frontend: PCHReader.cpp PCHWriter.cpp

Douglas Gregor dgregor at apple.com
Wed Apr 15 11:43:11 PDT 2009


Author: dgregor
Date: Wed Apr 15 13:43:11 2009
New Revision: 69196

URL: http://llvm.org/viewvc/llvm-project?rev=69196&view=rev
Log:
PCH support for the string literal of a FileScopeAsmDecl.
Some minor cleanup.


Modified:
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69196&r1=69195&r2=69196&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Apr 15 13:43:11 2009
@@ -188,7 +188,7 @@
 
 void PCHDeclReader::VisitFileScopeAsmDecl(FileScopeAsmDecl *AD) {
   VisitDecl(AD);
-  // FIXME: read asm string
+  AD->setAsmString(cast<StringLiteral>(Reader.ReadExpr()));
 }
 
 void PCHDeclReader::VisitBlockDecl(BlockDecl *BD) {
@@ -593,6 +593,7 @@
       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 @@
   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 @@
   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;  

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=69196&r1=69195&r2=69196&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Wed Apr 15 13:43:11 2009
@@ -194,12 +194,12 @@
 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::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::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
   VisitDecl(D);
-  // FIXME: Emit the string literal
+  Writer.AddExpr(D->getAsmString());
   Code = pch::DECL_FILE_SCOPE_ASM;
 }
 





More information about the cfe-commits mailing list