Add support for reading/writing inline asm
authorChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 23:43:17 +0000 (23:43 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 23:43:17 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25564 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/Reader.cpp
lib/Bytecode/Writer/Writer.cpp

index 6c91a4ad6a78f0e925eeeb488bd27028a6cc4f82..6a3251d68ad438a76bb8e0e76ec5bf000017d115 100644 (file)
@@ -2102,12 +2102,16 @@ void BytecodeReader::ParseModuleGlobalInfo() {
     if (Handler)
       Handler->handleTargetTriple(triple);
     
-    if (At != BlockEnd && !hasAlignment) {
+    if (!hasAlignment && At != BlockEnd) {
       // If the file has section info in it, read the section names now.
       unsigned NumSections = read_vbr_uint();
       while (NumSections--)
         SectionNames.push_back(read_str());
     }
+    
+    // If the file has module-level inline asm, read it now.
+    if (!hasAlignment && At != BlockEnd)
+      TheModule->setInlineAsm(read_str());
   }
 
   // If any globals are in specified sections, assign them now.
index c82665e9478ff6e545384280a0da752ba6160d78..ec0b250dce879bcece4234ec43e122230b13d577 100644 (file)
@@ -1030,6 +1030,9 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
   output_vbr((unsigned)SectionNames.size());
   for (unsigned i = 0, e = SectionNames.size(); i != e; ++i)
     output(SectionNames[i]);
+  
+  // Output the inline asm string.
+  output(M->getInlineAsm());
 }
 
 void BytecodeWriter::outputInstructions(const Function *F) {