PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/wrappers/llvm/library/values/llvm_instruction.e

http://github.com/tybor/Liberty
Specman e | 69 lines | 8 code | 14 blank | 47 comment | 0 complexity | 56e6bbc7d0d0f722c02bc2a97f83df30 MD5 | raw file
 1deferred class LLVM_INSTRUCTION
 2	-- The Instruction class is the common base class for all LLVM
 3	-- instructions. It provides only a few methods, but is a very commonly
 4	-- used class. The primary data tracked by the Instruction class itself is
 5	-- the opcode (instruction type) and the parent BasicBlock the Instruction
 6	-- is embedded into. To represent a specific type of instruction, one of
 7	-- many subclasses of Instruction are used.
 8
 9	-- Because the Instruction class subclasses the User class, its operands
10	-- can be accessed in the same way as for other Users (with the
11	-- getOperand()/getNumOperands() and op_begin()/op_end() methods).
12
13	-- An important file for the Instruction class is the llvm/Instruction.def
14	-- file. This file contains some meta-data about the various different
15	-- types of instructions in LLVM. It describes the enum values that are
16	-- used as opcodes (for example Instruction::Add and Instruction::ICmp), as
17	-- well as the concrete sub-classes of Instruction that implement the
18	-- instruction (for example BinaryOperator and CmpInst). Unfortunately, the
19	-- use of macros in this file confuses doxygen, so these enum values don't
20	-- show up correctly in the doxygen output.
21
22	-- Important Subclasses of the Instruction class are:
23	
24	-- BinaryOperator represents all two operand instructions whose operands must be the same type, except for the comparison instructions.
25	
26	-- CastInst, the parent of the 12 casting instructions. It provides common operations on cast instructions.
27	
28	-- CmpInst respresents the two comparison instructions, ICmpInst (integer opreands), and FCmpInst (floating point operands).
29	
30	-- TerminatorInst is the parent of all terminator instructions (those which can terminate a block).
31
32inherit LLVM_USER
33
34feature {ANY} -- TODO: Important Public Members of the Instruction class
35	parent: LLVM_BASIC_BLOCK
36		-- The parent block containing Current instruction
37	do
38		create Result.from_external_pointer(llvmget_param_parent(handle))
39	end
40
41-- bool mayWriteToMemory()
42-- Returns true if the instruction writes to memory, i.e. it is a call,free,invoke, or store.
43-- 
44-- unsigned getOpcode()
45-- Returns the opcode for the Instruction.
46-- 
47-- Instruction *clone() const
48-- Returns another instance of the specified instruction, identical in all ways to the original except that the instruction has no parent (ie it's not embedded into a BasicBlock), and it has no name
49-- 
50
51end -- class LLVM_INSTRUCTION
52
53-- Copyright (C) 2009-2017: LLVM Team and 2009 Paolo Redaelli
54
55-- This file is part of LLVM wrappers for Liberty Eiffel.
56--
57-- This library is free software: you can redistribute it and/or modify
58-- it under the terms of the GNU Lesser General Public License as published by
59-- the Free Software Foundation, version 3 of the License.
60--
61-- Liberty Eiffel is distributed in the hope that it will be useful,
62-- but WITHOUT ANY WARRANTY; without even the implied warranty of
63-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
64-- GNU General Public License for more details.
65--
66-- You should have received a copy of the GNU General Public License
67-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
68--
69