daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: asmcomp/asmlink.ml
  2. ===================================================================
  3. RCS file: /caml/ocaml/asmcomp/asmlink.ml,v
  4. retrieving revision 1.65
  5. diff -c -r1.65 asmlink.ml
  6. *** asmcomp/asmlink.ml  26 May 2004 11:10:27 -0000  1.65
  7. --- asmcomp/asmlink.ml  13 Dec 2005 17:58:12 -0000
  8. ***************
  9. *** 163,168 ****
  10. --- 163,186 ----
  11.       let compare = compare
  12.     end)
  13.  
  14. + module StringMap = Map.Make(String)
  15. +
  16. + let check_unique l =
  17. +   let seen = ref StringMap.empty in
  18. +   List.iter
  19. +     (fun (info,file_name,_) ->
  20. +        List.iter
  21. +    (fun n ->
  22. +       try
  23. +         let other = StringMap.find n !seen in
  24. +         raise (Error (Multiple_definition (n,other,file_name)))
  25. +       with Not_found ->
  26. +         seen := StringMap.add n file_name !seen
  27. +    )
  28. +    info.ui_defines
  29. +     )
  30. +     l
  31. +
  32.   let make_startup_file ppf filename units_list =
  33.     let compile_phrase p = Asmgen.compile_phrase ppf p in
  34.     let oc = open_out filename in
  35. ***************
  36. *** 170,175 ****
  37. --- 188,194 ----
  38.     Location.input_name := "caml_startup"; (* set name of "current" input *)
  39.     Compilenv.reset "_startup"; (* set the name of the "current" compunit *)
  40.     Emit.begin_assembly();
  41. +   check_unique units_list;
  42.     let name_list =
  43.       List.flatten (List.map (fun (info,_,_) -> info.ui_defines) units_list) in
  44.     compile_phrase (Cmmgen.entry_point name_list);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top