-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
explicitly move and attribute compcert code
- Loading branch information
Showing
4 changed files
with
112 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(* *********************************************************************) | ||
(* *) | ||
(* The Compcert verified compiler *) | ||
(* *) | ||
(* Xavier Leroy, INRIA Paris-Rocquencourt *) | ||
(* *) | ||
(* Copyright Institut National de Recherche en Informatique et en *) | ||
(* Automatique. All rights reserved. This file is distributed *) | ||
(* under the terms of the GNU Lesser General Public License as *) | ||
(* published by the Free Software Foundation, either version 2.1 of *) | ||
(* the License, or (at your option) any later version. *) | ||
(* This file is also distributed under the terms of the *) | ||
(* INRIA Non-Commercial License Agreement. *) | ||
(* *) | ||
(* *********************************************************************) | ||
|
||
let camlstring_of_coqstring (s: char list) = | ||
let r = Bytes.create (List.length s) in | ||
let rec fill pos = function | ||
| [] -> r | ||
| c :: s -> Bytes.set r pos c; fill (pos + 1) s | ||
in Bytes.to_string (fill 0 s) | ||
|
||
|
||
let coqstring_of_camlstring s = | ||
let rec cstring accu pos = | ||
if pos < 0 then accu else cstring (s.[pos] :: accu) (pos - 1) | ||
in cstring [] (String.length s - 1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.