From bc7b2581cb34bca623b2525e2efdf9a1261d8888 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 23 Jan 2006 23:43:17 +0000 Subject: Add support for reading/writing inline asm llvm-svn: 25564 --- llvm/lib/Bytecode/Reader/Reader.cpp | 6 +++++- llvm/lib/Bytecode/Writer/Writer.cpp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Bytecode') diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index 6c91a4ad6a7..6a3251d68ad 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/lib/Bytecode/Reader/Reader.cpp @@ -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. diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index c82665e9478..ec0b250dce8 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -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) { -- cgit v1.2.3