llvm.org GIT mirror llvm / 7d30a2e
[OCaml] Expose Llvm.{set_,}unnamed_addr. Patch by Jacques-Pascal Deplaix <jp.deplaix@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250912 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 4 years ago
3 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
578578 external is_declaration : llvalue -> bool = "llvm_is_declaration"
579579 external linkage : llvalue -> Linkage.t = "llvm_linkage"
580580 external set_linkage : Linkage.t -> llvalue -> unit = "llvm_set_linkage"
581 external unnamed_addr : llvalue -> bool = "llvm_unnamed_addr"
582 external set_unnamed_addr : bool -> llvalue -> unit = "llvm_set_unnamed_addr"
581583 external section : llvalue -> string = "llvm_section"
582584 external set_section : string -> llvalue -> unit = "llvm_set_section"
583585 external visibility : llvalue -> Visibility.t = "llvm_visibility"
12541254 See the method [llvm::GlobalValue::setLinkage]. *)
12551255 val set_linkage : Linkage.t -> llvalue -> unit
12561256
1257 (** [unnamed_addr g] returns [true] if the global value [g] has the unnamed_addr
1258 attribute. Returns [false] otherwise.
1259 See the method [llvm::GlobalValue::getUnnamedAddr]. *)
1260 val unnamed_addr : llvalue -> bool
1261
1262 (** [set_unnamed_addr b g] if [b] is [true], sets the unnamed_addr attribute of
1263 the global value [g]. Unset it otherwise.
1264 See the method [llvm::GlobalValue::setUnnamedAddr]. *)
1265 val set_unnamed_addr : bool -> llvalue -> unit
1266
12571267 (** [section g] returns the linker section of the global value [g].
12581268 See the method [llvm::GlobalValue::getSection]. *)
12591269 val section : llvalue -> string
939939 return Val_unit;
940940 }
941941
942 /* llvalue -> bool */
943 CAMLprim value llvm_unnamed_addr(LLVMValueRef Global) {
944 return Val_bool(LLVMHasUnnamedAddr(Global));
945 }
946
947 /* bool -> llvalue -> unit */
948 CAMLprim value llvm_set_unnamed_addr(value UseUnnamedAddr, LLVMValueRef Global) {
949 LLVMSetUnnamedAddr(Global, Bool_val(UseUnnamedAddr));
950 return Val_unit;
951 }
952
942953 /* llvalue -> string */
943954 CAMLprim value llvm_section(LLVMValueRef Global) {
944955 return caml_copy_string(LLVMGetSection(Global));