Lines Matching refs:Stream
114 unsigned AbbrevToUse, BitstreamWriter &Stream) {
125 Stream.EmitRecord(Code, Vals, AbbrevToUse);
130 BitstreamWriter &Stream) {
134 Stream.EnterSubblock(bitc::PARAMATTR_BLOCK_ID, 3);
155 Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record);
159 Stream.ExitBlock();
163 BitstreamWriter &Stream) {
165 Stream.EnterSubblock(bitc::TYPE_SYMTAB_BLOCK_ID_OLD, 3);
174 unsigned V7Abbrev = Stream.EmitAbbrev(Abbv);
202 Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, is7Bit ? V7Abbrev : 0);
226 Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, is7Bit ? V7Abbrev : 0);
231 Stream.ExitBlock();
235 static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
238 Stream.EnterSubblock(bitc::TYPE_BLOCK_ID_OLD, 4 /*count from # abbrevs */);
247 unsigned PtrAbbrev = Stream.EmitAbbrev(Abbv);
257 unsigned FunctionAbbrev = Stream.EmitAbbrev(Abbv);
267 unsigned StructAnonAbbrev = Stream.EmitAbbrev(Abbv);
274 unsigned StructNameAbbrev = Stream.EmitAbbrev(Abbv);
283 unsigned StructNamedAbbrev = Stream.EmitAbbrev(Abbv);
293 unsigned StructAbbrev = Stream.EmitAbbrev(Abbv);
301 unsigned ArrayAbbrev = Stream.EmitAbbrev(Abbv);
305 Stream.EmitRecord(bitc::TYPE_CODE_NUMENTRY, TypeVals);
383 Stream.EmitRecord(Code, TypeVals, AbbrevToUse);
387 Stream.ExitBlock();
389 WriteTypeSymbolTable(VE, Stream);
426 BitstreamWriter &Stream) {
429 WriteStringRecord(bitc::MODULE_CODE_DEPLIB, *I, 0/*TODO*/, Stream);
434 0/*TODO*/, Stream);
437 0/*TODO*/, Stream);
440 0/*TODO*/, Stream);
458 0/*TODO*/, Stream);
468 0/*TODO*/, Stream);
477 0/*TODO*/, Stream);
507 SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv);
536 Stream.EmitRecord(bitc::MODULE_CODE_GLOBALVAR, Vals, AbbrevToUse);
556 Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
568 Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse);
593 BitstreamWriter &Stream,
606 Stream.EmitRecord(MDCode, Record, 0);
612 BitstreamWriter &Stream) {
622 Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
625 WriteMDNode(N, VE, Stream, Record);
629 Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
636 MDSAbbrev = Stream.EmitAbbrev(Abbv);
644 Stream.EmitRecord(bitc::METADATA_STRING, Record, MDSAbbrev);
654 Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
662 Stream.EmitRecord(bitc::METADATA_NAME, Record, 0/*TODO*/);
668 Stream.EmitRecord(METADATA_NAMED_NODE_2_7, Record, 0);
673 Stream.ExitBlock();
678 BitstreamWriter &Stream) {
686 Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
689 WriteMDNode(N, VE, Stream, Record);
693 Stream.ExitBlock();
698 BitstreamWriter &Stream) {
699 Stream.EnterSubblock(bitc::METADATA_ATTACHMENT_ID, 3);
722 Stream.EmitRecord(METADATA_ATTACHMENT_2_7, Record, 0);
726 Stream.ExitBlock();
729 static void WriteModuleMetadataStore(const Module *M, BitstreamWriter &Stream) {
739 Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
746 Stream.EmitRecord(bitc::METADATA_KIND, Record, 0);
750 Stream.ExitBlock();
755 BitstreamWriter &Stream, bool isGlobal) {
758 Stream.EnterSubblock(bitc::CONSTANTS_BLOCK_ID, 4);
771 AggregateAbbrev = Stream.EmitAbbrev(Abbv);
778 String8Abbrev = Stream.EmitAbbrev(Abbv);
784 CString7Abbrev = Stream.EmitAbbrev(Abbv);
790 CString6Abbrev = Stream.EmitAbbrev(Abbv);
803 Stream.EmitRecord(bitc::CST_CODE_SETTYPE, Record,
823 Stream.EmitRecord(bitc::CST_CODE_INLINEASM, Record);
993 Stream.EmitRecord(Code, Record, AbbrevToUse);
997 Stream.ExitBlock();
1001 BitstreamWriter &Stream) {
1008 WriteConstants(i, Vals.size(), VE, Stream, true);
1034 /// WriteInstruction - Emit an instruction to the specified stream.
1036 ValueEnumerator &VE, BitstreamWriter &Stream,
1258 Stream.EmitRecord(Code, Vals, AbbrevToUse);
1265 BitstreamWriter &Stream) {
1267 Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 4);
1314 Stream.EmitRecord(Code, NameVals, AbbrevToUse);
1317 Stream.ExitBlock();
1320 /// WriteFunction - Emit a function body to the module stream.
1322 BitstreamWriter &Stream) {
1323 Stream.EnterSubblock(bitc::FUNCTION_BLOCK_ID, 4);
1331 Stream.EmitRecord(bitc::FUNC_CODE_DECLAREBLOCKS, Vals);
1337 WriteConstants(CstStart, CstEnd, VE, Stream, false);
1340 WriteFunctionLocalMetadata(F, VE, Stream);
1353 WriteInstruction(*I, InstID, VE, Stream, Vals);
1367 Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC_AGAIN, Vals);
1376 Stream.EmitRecord(FUNC_CODE_DEBUG_LOC_2_7, Vals);
1384 WriteValueSymbolTable(F.getValueSymbolTable(), VE, Stream);
1387 WriteMetadataAttachment(F, VE, Stream);
1389 Stream.ExitBlock();
1393 static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) {
1397 Stream.EnterBlockInfoBlock(2);
1405 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
1416 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
1426 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
1436 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
1448 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
1457 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
1470 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
1477 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
1490 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1500 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1511 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1522 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1530 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1538 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1545 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1550 Stream.ExitBlock();
1555 static void WriteModule(const Module *M, BitstreamWriter &Stream) {
1556 Stream.EnterSubblock(bitc::MODULE_BLOCK_ID, 3);
1562 Stream.EmitRecord(bitc::MODULE_CODE_VERSION, Vals);
1569 WriteBlockInfo(VE, Stream);
1572 WriteAttributeTable(VE, Stream);
1575 WriteTypeTable(VE, Stream);
1579 WriteModuleInfo(M, VE, Stream);
1582 WriteModuleConstants(VE, Stream);
1585 WriteModuleMetadata(M, VE, Stream);
1590 WriteFunction(*F, VE, Stream);
1593 WriteModuleMetadataStore(M, Stream);
1596 WriteValueSymbolTable(M->getValueSymbolTable(), VE, Stream);
1598 Stream.ExitBlock();
1619 static void EmitDarwinBCHeader(BitstreamWriter &Stream, const Triple &TT) {
1648 Stream.Emit(0x0B17C0DE, 32);
1649 Stream.Emit(0 , 32); // Version.
1650 Stream.Emit(BCOffset , 32);
1651 Stream.Emit(0 , 32); // Filled in later.
1652 Stream.Emit(CPUType , 32);
1657 static void EmitDarwinBCTrailer(BitstreamWriter &Stream, unsigned BufferSize) {
1659 Stream.BackpatchWord(DarwinBCSizeFieldOffset, BufferSize-DarwinBCHeaderSize);
1663 Stream.Emit(0, 8);
1670 /// stream.
1673 BitstreamWriter Stream(Buffer);
1677 WriteBitcodeToStream( M, Stream );
1684 /// stream.
1685 void llvm_2_9::WriteBitcodeToStream(const Module *M, BitstreamWriter &Stream) {
1690 EmitDarwinBCHeader(Stream, TT);
1693 Stream.Emit((unsigned)'B', 8);
1694 Stream.Emit((unsigned)'C', 8);
1695 Stream.Emit(0x0, 4);
1696 Stream.Emit(0xC, 4);
1697 Stream.Emit(0xE, 4);
1698 Stream.Emit(0xD, 4);
1701 WriteModule(M, Stream);
1704 EmitDarwinBCTrailer(Stream, Stream.getBuffer().size());