aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/WriterInternals.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 19:33:40 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 19:33:40 +0000
commitb11f1a9ee167d278923e741cd11ccd0bfe58f816 (patch)
treeecabffc72b7ac17c1eb731d6ad1b37b464f54b17 /lib/Bytecode/Writer/WriterInternals.h
parent5f32c01dead5623d874f442b34762f9d111be4cf (diff)
remove the old bc writer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/WriterInternals.h')
-rw-r--r--lib/Bytecode/Writer/WriterInternals.h138
1 files changed, 0 insertions, 138 deletions
diff --git a/lib/Bytecode/Writer/WriterInternals.h b/lib/Bytecode/Writer/WriterInternals.h
deleted file mode 100644
index c4dbf474a0..0000000000
--- a/lib/Bytecode/Writer/WriterInternals.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//===- WriterInternals.h - Data structures shared by the Writer -*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the interface used between components of the bytecode
-// writer.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIB_BYTECODE_WRITER_WRITERINTERNALS_H
-#define LLVM_LIB_BYTECODE_WRITER_WRITERINTERNALS_H
-
-#include "SlotCalculator.h"
-#include "llvm/Bytecode/Writer.h"
-#include "llvm/Bytecode/Format.h"
-#include "llvm/Instruction.h"
-
-namespace llvm {
- class InlineAsm;
- class TypeSymbolTable;
- class ValueSymbolTable;
- class ParamAttrsList;
-
-class BytecodeWriter {
- std::vector<unsigned char> &Out;
- SlotCalculator Table;
-public:
- BytecodeWriter(std::vector<unsigned char> &o, const Module *M);
-
-private:
- void outputConstants();
- void outputConstantStrings();
- void outputFunction(const Function *F);
- void outputInstructions(const Function *F);
- void outputInstruction(const Instruction &I);
- void outputInstructionFormat0(const Instruction *I, unsigned Opcode,
- const SlotCalculator &Table,
- unsigned Type);
- void outputInstrVarArgsCall(const Instruction *I,
- unsigned Opcode,
- const SlotCalculator &Table,
- unsigned Type) ;
- inline void outputInstructionFormat1(const Instruction *I,
- unsigned Opcode,
- unsigned *Slots,
- unsigned Type) ;
- inline void outputInstructionFormat2(const Instruction *I,
- unsigned Opcode,
- unsigned *Slots,
- unsigned Type) ;
- inline void outputInstructionFormat3(const Instruction *I,
- unsigned Opcode,
- unsigned *Slots,
- unsigned Type) ;
-
- void outputModuleInfoBlock(const Module *C);
- void outputTypeSymbolTable(const TypeSymbolTable &TST);
- void outputValueSymbolTable(const ValueSymbolTable &ST);
- void outputTypes(unsigned StartNo);
- void outputParamAttrsList(const ParamAttrsList* Attrs);
- void outputConstantsInPlane(const Value *const*Plane, unsigned PlaneSize,
- unsigned StartNo);
- void outputConstant(const Constant *CPV);
- void outputInlineAsm(const InlineAsm *IA);
- void outputType(const Type *T);
-
- /// @brief Unsigned integer output primitive
- inline void output(unsigned i, int pos = -1);
-
- /// @brief Signed integer output primitive
- inline void output(int i);
-
- /// @brief 64-bit variable bit rate output primitive.
- inline void output_vbr(uint64_t i);
-
- /// @brief 32-bit variable bit rate output primitive.
- inline void output_vbr(unsigned i);
-
- /// @brief Signed 64-bit variable bit rate output primitive.
- inline void output_vbr(int64_t i);
-
- /// @brief Signed 32-bit variable bit rate output primitive.
- inline void output_vbr(int i);
-
- inline void output_str(const char *Str, unsigned Len);
- inline void output(const std::string &s) {
- output_str(&s[0], s.size());
- }
-
- inline void output_data(const void *Ptr, const void *End);
-
- inline void output_float(float& FloatVal);
- inline void output_double(double& DoubleVal);
-
- inline void output_typeid(unsigned i);
-
- inline size_t size() const { return Out.size(); }
- inline void resize(size_t S) { Out.resize(S); }
- friend class BytecodeBlock;
-};
-
-/// BytecodeBlock - Little helper class is used by the bytecode writer to help
-/// do backpatching of bytecode block sizes really easily. It backpatches when
-/// it goes out of scope.
-///
-class BytecodeBlock {
- unsigned Id;
- unsigned Loc;
- BytecodeWriter& Writer;
-
- /// ElideIfEmpty - If this is true and the bytecode block ends up being empty,
- /// the block can remove itself from the output stream entirely.
- bool ElideIfEmpty;
-
- /// If this is true then the block is written with a long format header using
- /// a uint (32-bits) for both the block id and size. Otherwise, it uses the
- /// short format which is a single uint with 27 bits for size and 5 bits for
- /// the block id. Both formats are used in a bc file with version 1.3.
- /// Previously only the long format was used.
- bool HasLongFormat;
-
- BytecodeBlock(const BytecodeBlock &); // do not implement
- void operator=(const BytecodeBlock &); // do not implement
-public:
- inline BytecodeBlock(unsigned ID, BytecodeWriter& w,
- bool elideIfEmpty = false, bool hasLongFormat = false);
-
- inline ~BytecodeBlock();
-};
-
-} // End llvm namespace
-
-#endif