diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-19 19:22:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-19 19:22:45 +0000 |
commit | 0b6727dd9dea839644e0f47f868dbfd1e2f9f8ed (patch) | |
tree | d2325552becc347566e17b05aecbfd06ae106af4 /include/llvm | |
parent | 9bffa73530b3712b42f6e6bddf21f22b8aba276d (diff) | |
download | external_llvm-0b6727dd9dea839644e0f47f868dbfd1e2f9f8ed.zip external_llvm-0b6727dd9dea839644e0f47f868dbfd1e2f9f8ed.tar.gz external_llvm-0b6727dd9dea839644e0f47f868dbfd1e2f9f8ed.tar.bz2 |
These constructors are for internal use only. These should have been
protected a long time ago :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/InstrTypes.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 4aa612a..d37a171 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -22,11 +22,11 @@ class SymTabValue; // block. Thus, these are all the flow control type of operations. // class TerminatorInst : public Instruction { -public: +protected: TerminatorInst(Instruction::TermOps iType); TerminatorInst(const Type *Ty, Instruction::TermOps iType, const std::string &Name = ""); - inline ~TerminatorInst() {} +public: // Terminators must implement the methods required by Instruction... virtual Instruction *clone() const = 0; @@ -59,6 +59,12 @@ public: //===----------------------------------------------------------------------===// class UnaryOperator : public Instruction { +protected: + UnaryOperator(Value *S, UnaryOps iType, const std::string &Name = "") + : Instruction(S->getType(), iType, Name) { + Operands.reserve(1); + Operands.push_back(Use(S, this)); + } public: // create() - Construct a unary instruction, given the opcode @@ -66,12 +72,6 @@ public: // static UnaryOperator *create(UnaryOps Op, Value *Source); - UnaryOperator(Value *S, UnaryOps iType, const std::string &Name = "") - : Instruction(S->getType(), iType, Name) { - Operands.reserve(1); - Operands.push_back(Use(S, this)); - } - inline UnaryOps getOpcode() const { return (UnaryOps)Instruction::getOpcode(); } @@ -99,14 +99,7 @@ public: //===----------------------------------------------------------------------===// class BinaryOperator : public Instruction { -public: - - // create() - Construct a binary instruction, given the opcode - // and the two operands. - // - static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2, - const std::string &Name = ""); - +protected: BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const std::string &Name = "") : Instruction(S1->getType(), iType, Name) { @@ -117,6 +110,14 @@ public: Operands[0]->getType() == Operands[1]->getType()); } +public: + + // create() - Construct a binary instruction, given the opcode + // and the two operands. + // + static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2, + const std::string &Name = ""); + inline BinaryOps getOpcode() const { return (BinaryOps)Instruction::getOpcode(); } |