mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-06 12:26:45 +00:00
Incorporating review feedback for GC verifier patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42163 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a4ddacf60b
commit
a8c3660c1a
@ -158,6 +158,7 @@ GROFF := @GROFF@
|
|||||||
GZIP := @GZIP@
|
GZIP := @GZIP@
|
||||||
OCAMLC := @OCAMLC@
|
OCAMLC := @OCAMLC@
|
||||||
OCAMLOPT := @OCAMLOPT@
|
OCAMLOPT := @OCAMLOPT@
|
||||||
|
OCAMLDEP := @OCAMLDEP@
|
||||||
POD2HTML := @POD2HTML@
|
POD2HTML := @POD2HTML@
|
||||||
POD2MAN := @POD2MAN@
|
POD2MAN := @POD2MAN@
|
||||||
RUNTEST := @RUNTEST@
|
RUNTEST := @RUNTEST@
|
||||||
|
@ -534,6 +534,7 @@ DJ_AC_PATH_TCLSH
|
|||||||
AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
|
AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
|
||||||
AC_PATH_PROG(OCAMLC,[ocamlc],[echo "Skipped: ocamlc not found"])
|
AC_PATH_PROG(OCAMLC,[ocamlc],[echo "Skipped: ocamlc not found"])
|
||||||
AC_PATH_PROG(OCAMLOPT,[ocamlopt],[echo "Skipped: ocamlopt not found"])
|
AC_PATH_PROG(OCAMLOPT,[ocamlopt],[echo "Skipped: ocamlopt not found"])
|
||||||
|
AC_PATH_PROG(OCAMLDEP,[ocamldep],[echo "Skipped: ocamldep not found"])
|
||||||
|
|
||||||
dnl Determine if the linker supports the -R option.
|
dnl Determine if the linker supports the -R option.
|
||||||
AC_LINK_USE_R
|
AC_LINK_USE_R
|
||||||
|
@ -38,7 +38,7 @@ UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
OCAMLCFLAGS += -I $(OcamlDir)
|
OCAMLCFLAGS += -I $(OcamlDir) -I $(ObjDir)
|
||||||
OCAMLAFLAGS += $(patsubst %,-cclib %, \
|
OCAMLAFLAGS += $(patsubst %,-cclib %, \
|
||||||
$(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
|
$(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
|
||||||
$(UsedLibs) -l$(LIBRARYNAME))
|
$(UsedLibs) -l$(LIBRARYNAME))
|
||||||
@ -51,26 +51,26 @@ Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) -o)
|
|||||||
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) -o)
|
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) -o)
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
OcamlSources := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
|
OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
|
||||||
OcamlHeaders := $(OcamlSources:.ml=.mli)
|
OcamlHeaders1 := $(OcamlSources1:.ml=.mli)
|
||||||
|
|
||||||
# Output and intermediate files
|
OcamlSources := $(OcamlSources1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
|
||||||
# The .cmo files are the only intermediates; all others get installed.
|
OcamlHeaders := $(OcamlHeaders1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
|
||||||
BareLibraryA := lib$(LIBRARYNAME).a
|
|
||||||
LibraryA := $(OcamlDir)/$(BareLibraryA)
|
|
||||||
LibraryCMA := $(OcamlDir)/$(LIBRARYNAME).cma
|
|
||||||
LibraryCMXA := $(OcamlDir)/$(LIBRARYNAME).cmxa
|
|
||||||
ObjectsCMI := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/%.cmi)
|
|
||||||
ObjectsCMO := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(ObjDir)/%.cmo)
|
|
||||||
ObjectsCMX := $(OcamlSources:$(PROJ_SRC_DIR)/%.ml=$(OcamlDir)/%.cmx)
|
|
||||||
|
|
||||||
# Dependencies
|
# Intermediate files
|
||||||
# Punting on ocamldep, since its output is only suitable for builds where
|
LibraryCMA := $(ObjDir)/$(LIBRARYNAME).cma
|
||||||
# objects are placed directly adjacent to sources, which is not us.
|
LibraryCMXA := $(ObjDir)/$(LIBRARYNAME).cmxa
|
||||||
# Unfortunately, this is subtly incorrect and leads to occasional problems.
|
ObjectsCMI := $(OcamlSources:%.ml=%.cmi)
|
||||||
# ocamlc/ocamlopt really need an option akin to gcc -M or gcc -MD.
|
ObjectsCMO := $(OcamlSources:%.ml=%.cmo)
|
||||||
$(ObjectsCMO): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
|
ObjectsCMX := $(OcamlSources:%.ml=%.cmx)
|
||||||
$(ObjectsCMX): $(ObjectsCMI) $(UsedOcamLibs:%=$(OcamlDir)/%.cmi)
|
|
||||||
|
# Output files
|
||||||
|
# The .cmo files are the only intermediates; all others are to be installed.
|
||||||
|
LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a
|
||||||
|
OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
|
||||||
|
OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
|
||||||
|
OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
|
||||||
|
OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
|
||||||
|
|
||||||
# Installation targets
|
# Installation targets
|
||||||
DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
|
DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
|
||||||
@ -78,6 +78,22 @@ DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
|
|||||||
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
|
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
|
||||||
|
|
||||||
|
|
||||||
|
##===- Dependencies -------------------------------------------------------===##
|
||||||
|
# Copy the sources into the intermediate directory because older ocamlc doesn't
|
||||||
|
# support -o except when linking (outputs are placed next to inputs).
|
||||||
|
|
||||||
|
$(ObjDir)/%.mli: $(PROJ_SRC_DIR)/%.mli $(ObjDir)/.dir
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
|
||||||
|
$(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
|
||||||
|
$(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders)
|
||||||
|
$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeader) > $@
|
||||||
|
|
||||||
|
-include $(ObjDir)/$(LIBRARYNAME).ocamldep
|
||||||
|
|
||||||
|
|
||||||
##===- Build static library from C sources --------------------------------===##
|
##===- Build static library from C sources --------------------------------===##
|
||||||
|
|
||||||
all-local:: $(LibraryA)
|
all-local:: $(LibraryA)
|
||||||
@ -112,33 +128,36 @@ clean-local:: clean-cmis
|
|||||||
install-local:: install-cmis
|
install-local:: install-cmis
|
||||||
uninstall-local:: uninstall-cmis
|
uninstall-local:: uninstall-cmis
|
||||||
|
|
||||||
build-cmis: $(ObjectsCMI)
|
build-cmis: $(OutputsCMI)
|
||||||
|
|
||||||
$(OcamlDir)/%.cmi: $(PROJ_SRC_DIR)/%.mli $(OcamlDir)/.dir
|
$(OcamlDir)/%.cmi: $(ObjDir)/%.cmi $(OcamlDir)/.dir
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
|
||||||
|
$(ObjDir)/%.cmi: $(ObjDir)/%.mli $(ObjDir)/.dir
|
||||||
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
|
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
|
||||||
$(Verb) $(Compile.CMI) $@ $<
|
$(Verb) $(Compile.CMI) $@ $<
|
||||||
|
|
||||||
clean-cmis::
|
clean-cmis::
|
||||||
-$(Verb) $(RM) -f $(ObjectsCMI)
|
-$(Verb) $(RM) -f $(OutputsCMI)
|
||||||
|
|
||||||
# Also install the .mli's (headers) as documentation.
|
# Also install the .mli's (headers) as documentation.
|
||||||
install-cmis: $(ObjectsCMI)
|
install-cmis: $(OutputsCMI) $(OcamlHeaders)
|
||||||
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
||||||
$(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
|
$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
|
||||||
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
||||||
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
|
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
|
||||||
done
|
done
|
||||||
$(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders)); do \
|
$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
|
||||||
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
||||||
$(DataInstall) $(PROJ_SRC_DIR)/$$i "$(PROJ_libocamldir)/$$i"; \
|
$(DataInstall) $(ObjDir)/$$i "$(PROJ_libocamldir)/$$i"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall-cmis::
|
uninstall-cmis::
|
||||||
$(Verb) for i in $(patsubst $(OcamlDir)/%,%,$(ObjectsCMI)); do \
|
$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
|
||||||
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
||||||
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
|
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
|
||||||
done
|
done
|
||||||
$(Verb) for i in $(patsubst $(PROJ_SRC_DIR)/%,%,$(OcamlHeaders)); do \
|
$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
|
||||||
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
||||||
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
|
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
|
||||||
done
|
done
|
||||||
@ -146,11 +165,14 @@ uninstall-cmis::
|
|||||||
|
|
||||||
##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
|
##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
|
||||||
|
|
||||||
all-local:: $(LibraryCMA)
|
all-local:: $(OutputCMA)
|
||||||
clean-local:: clean-cma
|
clean-local:: clean-cma
|
||||||
install-local:: install-cma
|
install-local:: install-cma
|
||||||
uninstall-local:: uninstall-cma
|
uninstall-local:: uninstall-cma
|
||||||
|
|
||||||
|
$(OutputCMA): $(LibraryCMA) $(OcamlDir)/.dir
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
|
||||||
$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
|
$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
|
||||||
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
|
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
|
||||||
$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
|
$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
|
||||||
@ -158,17 +180,17 @@ $(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
|
|||||||
ln -sf "$(LibDir)/$$i" "$(OcamlDir)/$$i"; \
|
ln -sf "$(LibDir)/$$i" "$(OcamlDir)/$$i"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
$(ObjDir)/%.cmo: $(PROJ_SRC_DIR)/%.ml $(OcamlDir)/.dir
|
$(ObjDir)/%.cmo: $(ObjDir)/%.ml
|
||||||
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
|
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
|
||||||
$(Verb) $(Compile.CMO) $@ $<
|
$(Verb) $(Compile.CMO) $@ $<
|
||||||
|
|
||||||
clean-cma::
|
clean-cma::
|
||||||
$(Verb) $(RM) -f $(LibraryCMA)
|
$(Verb) $(RM) -f $(OutputCMA) $(UsedLibNames:%=$(OcamlDir)/%)
|
||||||
|
|
||||||
install-cma:: $(LibraryCMA)
|
install-cma:: $(OutputCMA)
|
||||||
$(Echo) "Installing $(BuildMode) $(DestCMA)"
|
$(Echo) "Installing $(BuildMode) $(DestCMA)"
|
||||||
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
||||||
$(Verb) $(DataInstall) $(LibraryCMA) "$(DestCMA)"
|
$(Verb) $(DataInstall) $(OutputCMA) "$(DestCMA)"
|
||||||
$(Verb) for i in $(UsedLibNames); do \
|
$(Verb) for i in $(UsedLibNames); do \
|
||||||
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
||||||
ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
|
ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
|
||||||
@ -189,41 +211,47 @@ uninstall-cma::
|
|||||||
# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
|
# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
|
||||||
ifdef OCAMLOPT
|
ifdef OCAMLOPT
|
||||||
|
|
||||||
all-local:: $(LibraryCMXA)
|
all-local:: $(OutputCMXA) $(OutputsCMX)
|
||||||
clean-local:: clean-cmxa
|
clean-local:: clean-cmxa
|
||||||
install-local:: install-cmxa
|
install-local:: install-cmxa
|
||||||
uninstall-local:: uninstall-cmxa
|
uninstall-local:: uninstall-cmxa
|
||||||
|
|
||||||
|
$(OutputCMXA): $(LibraryCMXA)
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
$(Verb) $(CP) -f $(<:.cmxa=.a) $(@:.cmxa=.a)
|
||||||
|
|
||||||
|
$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
|
||||||
|
$(Verb) $(CP) -f $< $@
|
||||||
|
|
||||||
$(LibraryCMXA): $(ObjectsCMX)
|
$(LibraryCMXA): $(ObjectsCMX)
|
||||||
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
|
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
|
||||||
$(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
|
$(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
|
||||||
$(Verb) $(RM) -f $(@:.cmxa=.o)
|
$(Verb) $(RM) -f $(@:.cmxa=.o)
|
||||||
|
|
||||||
$(OcamlDir)/%.cmx: $(PROJ_SRC_DIR)/%.ml
|
$(ObjDir)/%.cmx: $(ObjDir)/%.ml
|
||||||
$(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
|
$(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
|
||||||
$(Verb) $(Compile.CMX) $@ $<
|
$(Verb) $(Compile.CMX) $@ $<
|
||||||
|
|
||||||
clean-cmxa::
|
clean-cmxa::
|
||||||
$(Verb) $(RM) -f $(LibraryCMXA) $(LibraryCMXA:.cmxa=.o) \
|
$(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.o) $(OutputsCMX)
|
||||||
$(LibraryCMXA:.cmxa=.a) $(ObjectsCMX)
|
|
||||||
|
|
||||||
install-cmxa:: $(LibraryCMXA)
|
install-cmxa:: $(OutputCMXA) $(OutputsCMX)
|
||||||
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
$(Verb) $(MKDIR) $(PROJ_libocamldir)
|
||||||
$(Echo) "Installing $(BuildMode) $(DestCMXA)"
|
$(Echo) "Installing $(BuildMode) $(DestCMXA)"
|
||||||
$(Verb) $(DataInstall) $(LibraryCMXA) $(DestCMXA)
|
$(Verb) $(DataInstall) $(OutputCMXA) $(DestCMXA)
|
||||||
$(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
|
$(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
|
||||||
$(Verb) $(DataInstall) $(LibraryCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
|
$(Verb) $(DataInstall) $(OutputCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
|
||||||
$(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
|
$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
|
||||||
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
|
||||||
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
|
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall-cmxa:: $(LibraryCMXA)
|
uninstall-cmxa::
|
||||||
$(Echo) "Uninstalling $(DestCMXA)"
|
$(Echo) "Uninstalling $(DestCMXA)"
|
||||||
$(Verb) $(RM) -f $(DestCMXA)
|
$(Verb) $(RM) -f $(DestCMXA)
|
||||||
$(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
|
$(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
|
||||||
$(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
|
$(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
|
||||||
$(Verb) for i in $(ObjectsCMX:$(OcamlDir)/%=%); do \
|
$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
|
||||||
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
|
||||||
$(RM) -f $(PROJ_libocamldir)/$$i; \
|
$(RM) -f $(PROJ_libocamldir)/$$i; \
|
||||||
done
|
done
|
||||||
@ -240,6 +268,7 @@ printcamlvars::
|
|||||||
$(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
|
$(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
|
||||||
$(Echo) "OCAMLC : " '$(OCAMLC)'
|
$(Echo) "OCAMLC : " '$(OCAMLC)'
|
||||||
$(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
|
$(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
|
||||||
|
$(Echo) "OCAMLDEP : " '$(OCAMLDEP)'
|
||||||
$(Echo) "Compile.CMI : " '$(Compile.CMI)'
|
$(Echo) "Compile.CMI : " '$(Compile.CMI)'
|
||||||
$(Echo) "Compile.CMO : " '$(Compile.CMO)'
|
$(Echo) "Compile.CMO : " '$(Compile.CMO)'
|
||||||
$(Echo) "Archive.CMA : " '$(Archive.CMA)'
|
$(Echo) "Archive.CMA : " '$(Archive.CMA)'
|
||||||
@ -248,7 +277,9 @@ printcamlvars::
|
|||||||
$(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
|
$(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
|
||||||
$(Echo) "LibraryCMA : " '$(LibraryCMA)'
|
$(Echo) "LibraryCMA : " '$(LibraryCMA)'
|
||||||
$(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
|
$(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
|
||||||
|
$(Echo) "OcamlSources1: " '$(OcamlSources1)'
|
||||||
$(Echo) "OcamlSources : " '$(OcamlSources)'
|
$(Echo) "OcamlSources : " '$(OcamlSources)'
|
||||||
|
$(Echo) "OcamlHeaders : " '$(OcamlHeaders)'
|
||||||
$(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
|
$(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
|
||||||
$(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
|
$(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
|
||||||
$(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
|
$(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
/* Llvm.llmodule -> string -> bool */
|
/* Llvm.llmodule -> string -> bool */
|
||||||
CAMLprim value llvm_write_bitcode_file(value M, value Path) {
|
CAMLprim value llvm_write_bitcode_file(value M, value Path) {
|
||||||
CAMLparam1(Path);
|
|
||||||
int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
|
int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
|
||||||
CAMLreturn(Val_bool(res == 0));
|
return Val_bool(res == 0);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ CAMLprim value llvm_param_types(value FunTy) {
|
|||||||
|
|
||||||
/* copy into an ocaml array */
|
/* copy into an ocaml array */
|
||||||
unsigned i;
|
unsigned i;
|
||||||
value ParamTys = caml_alloc(Count, 0);
|
value ParamTys = alloc(Count, 0);
|
||||||
|
|
||||||
LLVMGetFunctionParamTypes((LLVMTypeRef) FunTy, FunTys);
|
LLVMGetFunctionParamTypes((LLVMTypeRef) FunTy, FunTys);
|
||||||
for (i = 0; i != Count; ++i)
|
for (i = 0; i != Count; ++i)
|
||||||
@ -159,7 +159,7 @@ CAMLprim value llvm_element_types(value StructTy) {
|
|||||||
|
|
||||||
/* copy into an ocaml array */
|
/* copy into an ocaml array */
|
||||||
unsigned i;
|
unsigned i;
|
||||||
value ElementTys = caml_alloc(Count, 0);
|
value ElementTys = alloc(Count, 0);
|
||||||
|
|
||||||
LLVMGetStructElementTypes((LLVMTypeRef) StructTy, Tys);
|
LLVMGetStructElementTypes((LLVMTypeRef) StructTy, Tys);
|
||||||
for (i = 0; i != Count; ++i)
|
for (i = 0; i != Count; ++i)
|
||||||
@ -225,7 +225,7 @@ CAMLprim value llvm_type_of(value Val) {
|
|||||||
|
|
||||||
/* llvalue -> string */
|
/* llvalue -> string */
|
||||||
CAMLprim value llvm_value_name(value Val) {
|
CAMLprim value llvm_value_name(value Val) {
|
||||||
return caml_copy_string(LLVMGetValueName((LLVMValueRef) Val));
|
return copy_string(LLVMGetValueName((LLVMValueRef) Val));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* string -> llvalue -> unit */
|
/* string -> llvalue -> unit */
|
||||||
@ -296,7 +296,7 @@ CAMLprim value llvm_make_real_constant(value RealTy, value N) {
|
|||||||
/* string -> bool -> llvalue */
|
/* string -> bool -> llvalue */
|
||||||
CAMLprim value llvm_make_string_constant(value Str, value NullTerminate) {
|
CAMLprim value llvm_make_string_constant(value Str, value NullTerminate) {
|
||||||
return (value) LLVMGetStringConstant(String_val(Str),
|
return (value) LLVMGetStringConstant(String_val(Str),
|
||||||
caml_string_length(Str),
|
string_length(Str),
|
||||||
Bool_val(NullTerminate) == 0);
|
Bool_val(NullTerminate) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ CAMLprim value llvm_set_linkage(value Linkage, value Global) {
|
|||||||
|
|
||||||
/* llvalue -> string */
|
/* llvalue -> string */
|
||||||
CAMLprim value llvm_section(value Global) {
|
CAMLprim value llvm_section(value Global) {
|
||||||
return caml_copy_string(LLVMGetSection((LLVMValueRef) Global));
|
return copy_string(LLVMGetSection((LLVMValueRef) Global));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* string -> llvalue -> unit */
|
/* string -> llvalue -> unit */
|
||||||
|
@ -155,14 +155,17 @@ let test_constants () =
|
|||||||
(* RUN: grep {Const04.*"cruel\\\\00world"} < %t.ll
|
(* RUN: grep {Const04.*"cruel\\\\00world"} < %t.ll
|
||||||
*)
|
*)
|
||||||
group "string";
|
group "string";
|
||||||
let c = make_string_constant "cruel\x00world" false in
|
let c = make_string_constant "cruel\000world" false in
|
||||||
ignore (define_global "Const04" c m);
|
ignore (define_global "Const04" c m);
|
||||||
insist ((make_array_type i8_type 11) = type_of c);
|
insist ((make_array_type i8_type 11) = type_of c);
|
||||||
|
|
||||||
(* RUN: grep {Const05.*"hi\\\\00again\\\\00"} < %t.ll
|
(* RUN: grep {Const05.*"hi\\\\00again\\\\00"} < %t.ll
|
||||||
*)
|
*)
|
||||||
group "string w/ null";
|
group "string w/ null";
|
||||||
let c = make_string_constant "hi\x00again" true in
|
let c = make_string_constant "hi\000again" true in
|
||||||
|
prerr_string "====> ";
|
||||||
|
prerr_int (array_length (type_of c));
|
||||||
|
prerr_endline " <====";
|
||||||
ignore (define_global "Const05" c m);
|
ignore (define_global "Const05" c m);
|
||||||
insist ((make_array_type i8_type 9) = type_of c);
|
insist ((make_array_type i8_type 9) = type_of c);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user