]> granicus.if.org Git - clang/commitdiff
PCH support for the string literal of a FileScopeAsmDecl.
authorDouglas Gregor <dgregor@apple.com>
Wed, 15 Apr 2009 18:43:11 +0000 (18:43 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 15 Apr 2009 18:43:11 +0000 (18:43 +0000)
Some minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index 5a01aee8b8b6c701e0cac9696757fb06b455e9ee..983c2b880728bf0680fd2df5e17bd946dfb83269 100644 (file)
@@ -188,7 +188,7 @@ void PCHDeclReader::VisitOriginalParmVarDecl(OriginalParmVarDecl *PD) {
 
 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 @@ 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;  
index 0b5a2a65d15b7b5bc4a6f2c0fea319bd964e2016..46db1428e31bc55d38576f9dd90ad5a297acf254 100644 (file)
@@ -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;
 }