@@ -1437,6 +1437,37 @@ module Theory : sig
1437
1437
?package : string -> (* * defaults to ["user"] *)
1438
1438
string -> t
1439
1439
1440
+
1441
+
1442
+ (* * [register <variants> t] generates and registers a list of targets.
1443
+
1444
+ For a list of possible target properties generate a set of
1445
+ unique targets and declare them. To generate a unique name the
1446
+ following scheme is used,
1447
+
1448
+ {v<name>-<system>-<abi><fabi>-<format>+<option>...v}
1449
+
1450
+ where if a property is [:unknown] then it is not listed in
1451
+ the name (including the separator, if necessary).
1452
+
1453
+ E.g.,
1454
+ {v
1455
+ arm-linux-gnueabihf-elf
1456
+ armv7-linux-gnueabihf+m3
1457
+ v}
1458
+
1459
+ @since 2.5.0
1460
+ *)
1461
+
1462
+ val register :
1463
+ ?systems : system list ->
1464
+ ?abis : abi list ->
1465
+ ?fabis : fabi list ->
1466
+ ?filetypes : filetype list ->
1467
+ ?options : options list ->
1468
+ ?package : string ->
1469
+ t -> unit
1470
+
1440
1471
(* * [lookup ?package name] lookups a target with the given [name].
1441
1472
1442
1473
If [name] is unqualified then it is qualified with the
@@ -1447,6 +1478,77 @@ module Theory : sig
1447
1478
*)
1448
1479
val lookup : ?package : string -> string -> t option
1449
1480
1481
+
1482
+ (* * [select <reqs> ()] selects a target that matches requirements.
1483
+
1484
+ Selects the least specific target that belongs to [parent] and
1485
+ matches the specified requirements. If [unique] is [true] and
1486
+ there is no single match then raises an exception, otherwise
1487
+ returns the first in the family order match (i.e., the least
1488
+ specific of the matches).
1489
+
1490
+ If there are no matching targets returns [parent] if [strict]
1491
+ is [false], otherwise fails with an exception.
1492
+
1493
+ The matching procedure uses the [domain] structure of the
1494
+ corresponding parameters. A target matches the constraint if
1495
+ all properties of the target matches the corresponding
1496
+ parameters. A property matches a parameter if the property is
1497
+ greater or equal (in the domain order) than the parameter.
1498
+
1499
+ See also {!filter}.
1500
+
1501
+ @param parent defaults to [unknown]
1502
+ @param unique defaults to [false]
1503
+ @param strict defaults to [false]
1504
+ @param system defaults to [System.unknown]
1505
+ @param abi defaults to [Abi.unknown]
1506
+ @param fabi defaults to [Fabi.unknown]
1507
+ @param options defaults to [Options.empty]
1508
+
1509
+ @since 2.5.0 *)
1510
+ val select :
1511
+ ?unique : bool ->
1512
+ ?strict : bool ->
1513
+ ?parent : t ->
1514
+ ?system : system ->
1515
+ ?abi : abi ->
1516
+ ?fabi : fabi ->
1517
+ ?filetype : filetype ->
1518
+ ?options : options -> unit -> t
1519
+
1520
+
1521
+ (* * [filter <reqs> ()] selects targets that matches requirements.
1522
+
1523
+ Filters targets that belong to [parent] and match the
1524
+ specified requirements. The targets are returned in the family
1525
+ order, i.e., the least specific target is comming first. This
1526
+ is the same order in which [family] list targets.
1527
+
1528
+ The matching procedure uses the [domain] structure of the
1529
+ corresponding parameters. A target matches the constraint if
1530
+ all properties of the target matches the corresponding
1531
+ parameters. A property matches a parameter if the property is
1532
+ greater or equal (in the domain order) than the parameter.
1533
+
1534
+ See also {!select}.
1535
+
1536
+ @param parent defaults to [unknown]
1537
+ @param system defaults to [System.unknown]
1538
+ @param abi defaults to [Abi.unknown]
1539
+ @param fabi defaults to [Fabi.unknown]
1540
+ @param options defaults to [Options.empty]
1541
+
1542
+ @since 2.5.0 *)
1543
+ val filter :
1544
+ ?strict : bool ->
1545
+ ?parent : t ->
1546
+ ?system : system ->
1547
+ ?abi : abi ->
1548
+ ?fabi : fabi ->
1549
+ ?filetype : filetype ->
1550
+ ?options : options -> unit -> t list
1551
+
1450
1552
(* * [get ?package name] returns the target with the given [name].
1451
1553
1452
1554
If the target with the given name wasn't declared raises an
@@ -2308,7 +2410,19 @@ module Theory : sig
2308
2410
(* * The source code language.
2309
2411
2310
2412
@since 2.2.0 *)
2311
- module Language : KB .Enum. S with type t = language
2413
+ module Language : sig
2414
+ include KB.Enum. S with type t = language
2415
+
2416
+
2417
+ (* * {3 Predefined languages}
2418
+
2419
+ @since 2.5.0 *)
2420
+ val c : language
2421
+ val cxx : language
2422
+ val ada : language
2423
+ val fortran : language
2424
+ val pascal : language
2425
+ end
2312
2426
2313
2427
(* * Defines how multibyte words are stored in the memory.
2314
2428
@@ -2337,19 +2451,94 @@ module Theory : sig
2337
2451
2338
2452
(* * The Operating System.
2339
2453
@since 2.2.0 *)
2340
- module System : KB .Enum. S with type t = system
2454
+ module System : sig
2455
+ include KB.Enum. S with type t = system
2456
+
2457
+
2458
+ (* * {3 Predefined Operating System Interfaces}
2459
+
2460
+ @since 2.5.0 *)
2461
+
2462
+
2463
+ (* * Linux-based systems, including Android *)
2464
+ val linux : system
2465
+
2466
+ (* * Darwin-based systems, including iOS, macOS *)
2467
+ val darwin : system
2468
+
2469
+ (* * VxWorks RTOS *)
2470
+ val vxworks : system
2471
+
2472
+ (* * FreeBSD *)
2473
+ val freebsd : system
2474
+
2475
+ (* * [OpenBSD] *)
2476
+ val openbsd : system
2477
+
2478
+ (* * The MS Windows family of OSes *)
2479
+ val windows : system
2480
+
2481
+ (* * MS-DOS and other DOSes *)
2482
+ val msdos : system
2483
+
2484
+ (* * Unified Extensible Firmware Interface *)
2485
+ val uefi : system
2486
+
2487
+ (* * standalone *)
2488
+ val none : system
2489
+ end
2341
2490
2342
2491
(* * The Application Binary Interface name.
2343
2492
@since 2.2.0 *)
2344
- module Abi : KB .Enum. S with type t = abi
2493
+ module Abi : sig
2494
+ include KB.Enum. S with type t = abi
2495
+
2496
+ (* * {3 Predefined ABI}
2497
+ @since 2.5.0 *)
2498
+
2499
+ (* * GNU/SysV *)
2500
+ val gnu : abi
2501
+
2502
+ (* * ARM EABI (use gnu for linux targets) *)
2503
+ val eabi : abi
2504
+
2505
+ (* * GNU ARM EABI *)
2506
+ val gnueabi : abi
2507
+
2508
+ val cdecl : abi
2509
+ val stdcall : abi
2510
+ val fastcall : abi
2511
+ val watcom : abi
2512
+ val ms : abi
2513
+ end
2345
2514
2346
2515
(* * The Application Floating-point Binary Interface name.
2347
2516
@since 2.2.0 *)
2348
- module Fabi : KB .Enum. S with type t = fabi
2517
+ module Fabi : sig
2518
+ include KB.Enum. S with type t = fabi
2519
+
2520
+
2521
+ (* * {3 Predefined FABI}
2522
+
2523
+ @since 2.5.0 *)
2524
+ val hard : fabi
2525
+ val soft : fabi
2526
+ end
2349
2527
2350
2528
(* * The file type that is used to pack the unit.
2351
2529
@since 2.3.0 *)
2352
- module Filetype : KB .Enum. S with type t = filetype
2530
+ module Filetype : sig
2531
+ include KB.Enum. S with type t = filetype
2532
+
2533
+
2534
+ (* * {3 Predefined File Formats}
2535
+
2536
+ @since 2.5.0 *)
2537
+ val elf : filetype
2538
+ val coff : filetype
2539
+ val macho : filetype
2540
+ val aout : filetype
2541
+ end
2353
2542
2354
2543
(* * Information about the compiler.
2355
2544
0 commit comments