PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://github.com/tybor/Liberty
Specman e | 61 lines | 35 code | 10 blank | 16 comment | 0 complexity | 6739317a8e1ac6ba0c61caed24ab926b MD5 | raw file
 1class LLVM_GLOBAL_VARIABLE
 2inherit LLVM_GLOBAL_VALUE 
 3create {WRAPPER, WRAPPER_HANDLER} from_external_pointer
 4feature {ANY} -- Queries
 5	initializer: LLVM_VALUE
 6		do
 7			create Result.from_external_pointer(llvmget_initializer(handle))
 8		ensure non_void: Result/=Void
 9		end
10
11	is_thread_local: BOOLEAN
12		do
13			Result:=llvmis_thread_local(handle).to_boolean
14		end
15
16	is_global_constant: BOOLEAN
17		do
18			Result:=llvmis_global_constant(handle).to_boolean
19		end
20
21feature {ANY} -- Commands
22	set_initializer (a_constant_value: LLVM_VALUE)
23	require a_constant_value/=Void
24	do
25		llvmset_initializer(handle,a_constant_value.handle)
26	ensure set: initializer.is_equal(a_constant_value)
27	end
28
29	set_thread_local (a_setting: BOOLEAN)
30	do
31		llvmset_thread_local(handle,a_setting.to_integer)
32	ensure set: is_thread_local=a_setting
33	end
34
35	set_global_constant (a_setting: BOOLEAN)
36	do
37		llvmset_global_constant(handle,a_setting.to_integer)
38	ensure set: is_global_constant=a_setting
39	end
40
41-- TODO: provide deletiong feature delete do	Precursor llvmdelete_global(handle)	end
42
43end -- class LLVM_GLOBAL_VARIABLE
44
45-- Copyright (C) 2010-2017: Paolo Redaelli
46
47-- This file is part of LLVM wrappers for Liberty Eiffel.
48--
49-- This library is free software: you can redistribute it and/or modify
50-- it under the terms of the GNU Lesser General Public License as published by
51-- the Free Software Foundation, version 3 of the License.
52--
53-- Liberty Eiffel is distributed in the hope that it will be useful,
54-- but WITHOUT ANY WARRANTY; without even the implied warranty of
55-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
56-- GNU General Public License for more details.
57--
58-- You should have received a copy of the GNU General Public License
59-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
60--
61