Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
126986a7
Commit
126986a7
authored
Mar 22, 2018
by
Raphael Rieu-Helft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for compiler plugins and a use case
parent
7b1be96e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
1 deletion
+70
-1
.merlin.in
.merlin.in
+1
-1
Makefile.in
Makefile.in
+10
-0
configure.in
configure.in
+32
-0
src/util/debug_optim.ml
src/util/debug_optim.ml
+27
-0
No files found.
.merlin.in
View file @
126986a7
...
...
@@ -43,4 +43,4 @@ B plugins/tptp
B plugins/python
B lib/why3
PKG str unix num dynlink @ZIPLIB@ @LABLGTK2PKG@ @META_OCAMLGRAPH@
PKG str unix num dynlink @
COMPILERLIBSPKG@ @
ZIPLIB@ @LABLGTK2PKG@ @META_OCAMLGRAPH@
Makefile.in
View file @
126986a7
...
...
@@ -281,6 +281,16 @@ endif
src/util/strings.cmo
:
WARNINGS:=$(WARNINGS)-3
src/util/strings.cmx
:
WARNINGS:=$(WARNINGS)-3
# compiler plugins
ifeq
(@enable_compiler_plugins@,yes)
$(LIBCMO) $(LIBCMX)
:
INCLUDES += -I @COMPILERLIBS@
src/utils/debug_optim.cmxs
:
$(OCAMLOPT)
-I
@COMPILERLIBS@
-for-pack
Why3
-shared
src/util/debug_optim.ml
-o
src/util/debug_optim.cmxs
src/transform/reification.cmx
:
src/utils/debug_optim.cmxs
src/transform/reification.cmx
:
OFLAGS += -plugin debug_optim.cmxs
endif
# hide warning 'no cmx file was found in path for module ..., and its interface was not compiled with -opaque' for the coq tactic
src/coq-tactic/why3tac.cmx
:
WARNINGS:=$(WARNINGS)-58
...
...
configure.in
View file @
126986a7
...
...
@@ -340,6 +340,33 @@ else
OCAMLINSTALLLIB=$OCAMLLIB
fi
# compiler plugins
AX_VERSION_GE([$OCAMLVERSION], 4.03.0,
[if test "$USEOCAMLFIND" = yes; then
COMPILERLIBS=$(ocamlfind query compiler-libs)
fi
if test -n "$COMPILERLIBS"; then
echo "ocamlfind found compiler-libs in $COMPILERLIBS"
enable_compiler_plugins="yes"
else
COMPILERLIBS="+compiler-libs"
AC_CHECK_FILE($OCAMLLIB/compiler-libs/,
enable_compiler_plugins=yes,
enable_compiler_plugins=no)
if test "$enable_compiler_plugins" = no; then
reason_compiler_plugins=" (compiler-libs not found)"
fi
fi],
[enable_compiler_plugins="no"
reason_compiler_plugins=" (Ocaml version 4.03.0 required)"])
if test "$enable_compiler_plugins" = yes; then
COMPILERLIBSPKG="compiler-libs"
else
COMPILERLIBSPKG=
fi
# checking for rubber
if test "$enable_doc" = yes ; then
AC_CHECK_PROG(RUBBER,rubber,rubber,no)
...
...
@@ -847,6 +874,10 @@ AC_SUBST(HASJSOFOCAML)
AC_SUBST(META_OCAMLGRAPH)
AC_SUBST(enable_compiler_plugins)
AC_SUBST(COMPILERLIBS)
AC_SUBST(COMPILERLIBSPKG)
AC_SUBST(enable_zarith)
AC_SUBST(BIGINTINCLUDE)
AC_SUBST(BIGINTLIB)
...
...
@@ -938,6 +969,7 @@ echo " Version : $OCAMLVERSION"
echo " Library path : $OCAMLLIB"
echo " Native compilation : $enable_native_code"
echo " Profiling : $enable_profiling"
echo " Compiler plugins : $enable_compiler_plugins$reason_compiler_plugins"
echo "Components"
echo " Why3 library : $enable_why3_lib"
echo " GTK IDE : $enable_ide$reason_ide"
...
...
src/util/debug_optim.ml
0 → 100644
View file @
126986a7
open
Parsetree
open
Ast_mapper
open
Asttypes
open
Longident
let
ast_mapper
=
{
Ast_mapper
.
default_mapper
with
expr
=
fun
mapper
expr
->
match
expr
with
|
{
pexp_desc
=
Pexp_apply
({
pexp_desc
=
Pexp_ident
{
txt
=
Ldot
(
Lident
"Debug"
,
"dprintf"
)}}
,
flag
::
_args
)
}
as
app
->
let
open
Ast_helper
in
Exp
.
ifthenelse
(
Exp
.
apply
(
Exp
.
ident
{
txt
=
Ldot
(
Lident
"Debug"
,
"test_flag"
);
loc
=
Location
.
none
(*TODO*)
})
[
flag
])
app
None
|
other
->
default_mapper
.
expr
mapper
other
;
}
let
transform
_hook_info
structure
=
ast_mapper
.
structure
ast_mapper
structure
let
()
=
Pparse
.
ImplementationHooks
.
add_hook
"Debug hook"
transform
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment