diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-04 18:26:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-04 18:26:27 +0000 |
commit | 07faafc8f95918b53f68862de60997a1f9c2751b (patch) | |
tree | bb4efe449b3fc3946d1606ffb95874f3206501dd /lib/Bitcode/Writer | |
parent | a727d5502c8e23c090da658bf14c5ebc1169a070 (diff) | |
download | external_llvm-07faafc8f95918b53f68862de60997a1f9c2751b.zip external_llvm-07faafc8f95918b53f68862de60997a1f9c2751b.tar.gz external_llvm-07faafc8f95918b53f68862de60997a1f9c2751b.tar.bz2 |
stub out creation of BLOCKINFO_BLOCK
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 9000a5b..6a7ed2d 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -858,6 +858,28 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) { Stream.ExitBlock(); } +// Emit blockinfo, which defines the standard abbreviations etc. +static void WriteBlockInfo(BitstreamWriter &Stream) { + // We only want to emit block info records for blocks that have multiple + // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other + // blocks can defined their abbrevs inline. + Stream.EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, 2); + +#if 0 + // Configure TYPE_SYMTAB_BLOCK's. + + // Add an abbrev for VST_ENTRY where the characters each fit in 7 bits. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8); // Value ID + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, 3)); // Linkage. + + xxx = Stream.EmitAbbrev(Abbv); +#endif + Stream.ExitBlock(); +} + + /// WriteBitcodeToFile - Write the specified module to the specified output /// stream. void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) { @@ -874,6 +896,9 @@ void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) { Stream.Emit(0xE, 4); Stream.Emit(0xD, 4); + // Emit blockinfo, which defines the standard abbreviations etc. + WriteBlockInfo(Stream); + // Emit the module. WriteModule(M, Stream); |