diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 15:15:51 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 15:15:51 +0200 |
commit | b597ce896a8a9cd7c3ed028a34e0612229d1a36a (patch) | |
tree | 92e3df204d3e27d6b4c0ac56c3f7b292a4143d01 | |
parent | 0ae69bc62cbe50e1fb426c4816aef689c359c75a (diff) | |
parent | 1e19ffdc01a94b485b61b824ce2fa9e440e36ae7 (diff) | |
download | compcert-b597ce896a8a9cd7c3ed028a34e0612229d1a36a.tar.gz compcert-b597ce896a8a9cd7c3ed028a34e0612229d1a36a.zip |
Merge branch 'master' into dwarf
-rw-r--r-- | backend/PrintXTL.ml | 3 | ||||
-rw-r--r-- | backend/RTLgenaux.ml | 1 | ||||
-rw-r--r-- | backend/Stacking.v | 2 | ||||
-rwxr-xr-x | configure | 12 | ||||
-rw-r--r-- | cparser/Lexer.mll | 7 |
5 files changed, 18 insertions, 7 deletions
diff --git a/backend/PrintXTL.ml b/backend/PrintXTL.ml index 08ccf129..b9813db0 100644 --- a/backend/PrintXTL.ml +++ b/backend/PrintXTL.ml @@ -102,6 +102,9 @@ let print_instruction pp succ = function | Xbuiltin(ef, args, res) -> fprintf pp "%a = %s(%a)" vars res (name_of_external ef) vars args + | Xannot(ef, args) -> + fprintf pp "%s(%a)" + (name_of_external ef) (print_annot_args var) args | Xbranch s -> print_succ pp s succ | Xcond(cond, args, s1, s2) -> diff --git a/backend/RTLgenaux.ml b/backend/RTLgenaux.ml index 27a4908e..40bb5c41 100644 --- a/backend/RTLgenaux.ml +++ b/backend/RTLgenaux.ml @@ -73,6 +73,7 @@ let rec size_stmt = function | Stailcall(sg, eos, args) -> 3 + size_eos eos + size_exprs args + length_exprs args | Sbuiltin(optid, ef, args) -> 1 + size_exprs args + | Sannot(txt, args) -> 0 | Sseq(s1, s2) -> size_stmt s1 + size_stmt s2 | Sifthenelse(ce, s1, s2) -> size_condexpr ce + max (size_stmt s1) (size_stmt s2) diff --git a/backend/Stacking.v b/backend/Stacking.v index c17dc038..21cf6b73 100644 --- a/backend/Stacking.v +++ b/backend/Stacking.v @@ -135,7 +135,7 @@ Fixpoint transl_annot_arg (fe: frame_env) (a: annot_arg loc) : annot_arg mreg := | AA_base (R r) => AA_base r | AA_base (S Local ofs ty) => AA_loadstack (chunk_of_type ty) (Int.repr (offset_of_index fe (FI_local ofs ty))) - | AA_base (S _ _ __) => AA_int Int.zero (**r never happens *) + | AA_base (S _ _ _) => AA_int Int.zero (**r never happens *) | AA_int n => AA_int n | AA_long n => AA_long n | AA_float n => AA_float n @@ -95,7 +95,7 @@ case "$target" in esac system="linux" cc="${toolprefix}gcc" - cprepro="${toolprefix}gcc -U__GNUC__ -E" + cprepro="${toolprefix}gcc -std=c99 -U__GNUC__ -E" casm="${toolprefix}gcc -c" casmruntime="${toolprefix}gcc -c -Wa,-mregnames" clinker="${toolprefix}gcc" @@ -140,7 +140,7 @@ case "$target" in struct_return="int1-4" system="linux" cc="${toolprefix}gcc" - cprepro="${toolprefix}gcc -U__GNUC__ '-D__REDIRECT(name,proto,alias)=name proto' '-D__REDIRECT_NTH(name,proto,alias)=name proto' -E" + cprepro="${toolprefix}gcc -std=c99 -U__GNUC__ '-D__REDIRECT(name,proto,alias)=name proto' '-D__REDIRECT_NTH(name,proto,alias)=name proto' -E" casm="${toolprefix}gcc -c" clinker="${toolprefix}gcc" libmath="-lm";; @@ -152,7 +152,7 @@ case "$target" in struct_return="ref" system="linux" cc="${toolprefix}gcc -m32" - cprepro="${toolprefix}gcc -m32 -U__GNUC__ -E" + cprepro="${toolprefix}gcc -std=c99 -m32 -U__GNUC__ -E" casm="${toolprefix}gcc -m32 -c" clinker="${toolprefix}gcc -m32" libmath="-lm";; @@ -164,7 +164,7 @@ case "$target" in struct_return="int1248" # to check! system="bsd" cc="${toolprefix}gcc -m32" - cprepro="${toolprefix}gcc -m32 -U__GNUC__ -E" + cprepro="${toolprefix}gcc -std=c99 -m32 -U__GNUC__ -E" casm="${toolprefix}gcc -m32 -c" clinker="${toolprefix}gcc -m32" libmath="-lm";; @@ -176,7 +176,7 @@ case "$target" in struct_return="int1248" system="macosx" cc="${toolprefix}gcc -arch i386" - cprepro="${toolprefix}gcc -arch i386 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' '-D__asm(x)=' -E" + cprepro="${toolprefix}gcc -std=c99 -arch i386 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' '-D__asm(x)=' -E" casm="${toolprefix}gcc -arch i386 -c" case `uname -r` in [1-9].*|10.*|11.*) # up to MacOS 10.7 included @@ -193,7 +193,7 @@ case "$target" in struct_return="ref" system="cygwin" cc="${toolprefix}gcc -m32" - cprepro="${toolprefix}gcc -m32 -U__GNUC__ -E" + cprepro="${toolprefix}gcc -std=c99 -m32 -U__GNUC__ -E" casm="${toolprefix}gcc -m32 -c" clinker="${toolprefix}gcc -m32" libmath="-lm";; diff --git a/cparser/Lexer.mll b/cparser/Lexer.mll index 13c1248b..82e6589c 100644 --- a/cparser/Lexer.mll +++ b/cparser/Lexer.mll @@ -233,6 +233,11 @@ let hexadecimal_floating_constant = | hexadecimal_prefix (hexadecimal_digit_sequence as intpart) binary_exponent_part floating_suffix? +(* Preprocessing numbers *) +let preprocessing_number = + '.'? ['0'-'9'] + (['0'-'9' 'A'-'Z' 'a'-'z' '_' '.'] | ['e' 'E' 'p' 'P']['+' '-'])* + (* Character and string constants *) let simple_escape_sequence = '\\' ( ['\'' '\"' '?' '\\' 'a' 'b' 'e' 'f' 'n' 'r' 't' 'v'] as c) @@ -273,6 +278,8 @@ rule initial = parse | None -> None | Some c -> Some (String.make 1 c) }, currentLoc lexbuf)} + | preprocessing_number as s { error lexbuf "invalid numerical constant '%s'@ These characters form a preprocessor number, but not a constant" s; + CONSTANT (Cabs.CONST_INT "0", currentLoc lexbuf) } | "'" { let l = char_literal [] lexbuf in CONSTANT (Cabs.CONST_CHAR(false, l), currentLoc lexbuf) } |