Put back the top-level asm code; all tests pass now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46868 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 78916c5..55abe6f 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -38,6 +38,7 @@
 static unsigned nObjCCompatibleAlias = 0;
 static unsigned nObjCPropertyDecl = 0;
 static unsigned nLinkageSpecDecl = 0;
+static unsigned nFileScopeAsmDecl = 0;
 
 static bool StatSwitch = false;
 
@@ -169,7 +170,8 @@
               nObjCCategoryImpl*sizeof(ObjCCategoryImplDecl)+
               nObjCCompatibleAlias*sizeof(ObjCCompatibleAliasDecl)+
               nObjCPropertyDecl*sizeof(ObjCPropertyDecl)+
-              nLinkageSpecDecl*sizeof(LinkageSpecDecl)));
+              nLinkageSpecDecl*sizeof(LinkageSpecDecl)+
+              nFileScopeAsmDecl*sizeof(FileScopeAsmDecl)));
     
 }
 
@@ -240,6 +242,9 @@
     case LinkageSpec:
       nLinkageSpecDecl++;
       break;
+    case FileScopeAsm:
+      nFileScopeAsmDecl++;
+      break;
   }
 }
 
diff --git a/AST/DeclSerialization.cpp b/AST/DeclSerialization.cpp
index 146ebba..cb91846 100644
--- a/AST/DeclSerialization.cpp
+++ b/AST/DeclSerialization.cpp
@@ -67,6 +67,9 @@
       
     case Typedef:
       return TypedefDecl::CreateImpl(D);
+      
+    case FileScopeAsm:
+      return FileScopeAsmDecl::CreateImpl(D);
   }
 }
 
@@ -438,3 +441,23 @@
   Language = static_cast<LanguageIDs>(D.ReadInt());
   D.ReadPtr(this->D);
 }
+
+//===----------------------------------------------------------------------===//
+//      FileScopeAsm Serialization.
+//===----------------------------------------------------------------------===//
+
+void FileScopeAsmDecl::EmitImpl(llvm::Serializer& S) const
+{
+  Decl::EmitInRec(S);
+  S.EmitOwnedPtr(AsmString);
+}
+
+FileScopeAsmDecl* FileScopeAsmDecl::CreateImpl(Deserializer& D) { 
+  FileScopeAsmDecl* decl = new FileScopeAsmDecl(SourceLocation(), 0);
+
+  decl->Decl::ReadInRec(D);
+  decl->AsmString = cast<StringLiteral>(D.ReadOwnedPtr<Expr>());
+//  D.ReadOwnedPtr(D.ReadOwnedPtr<StringLiteral>())<#T * * Ptr#>, <#bool AutoRegister#>)(decl->AsmString);
+  
+  return decl;
+}