llvminfo.pas 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {
  2. Copyright (c) 2010, 2013, 2015 by Jonas Maebe
  3. Basic Processor information for LLVM
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. Unit llvminfo;
  11. Interface
  12. uses
  13. globtype;
  14. Type
  15. { possible supported processors for this target }
  16. tllvmversion =
  17. ({ may add older/newer versions if required/appropriate }
  18. llvmver_3_3,
  19. llvmver_3_4_0,
  20. llvmver_3_4_1,
  21. llvmver_3_4_2,
  22. llvmver_3_5_0,
  23. llvmver_3_5_1,
  24. llvmver_3_5_2,
  25. llvmver_3_6_0,
  26. llvmver_3_6_1,
  27. llvmver_3_6_2,
  28. { Xcode versions use snapshots of LLVM and don't correspond to released
  29. versions of llvm (they don't ship with the llvm utilities either, but
  30. they do come with Clang, which can also be used to some extent instead
  31. of opt/llc) }
  32. llvmver_xc_6_4
  33. );
  34. type
  35. tllvmversionflag = (
  36. llvmflag_metadata_keyword, { use "metadata" keyword (others leave it away, except when metadata is an argument to call instructions) }
  37. llvmflag_linker_private { have linker_private linkage type (later versions use global in combination with hidden visibility) }
  38. );
  39. tllvmversionflags = set of tllvmversionflag;
  40. Const
  41. llvmversionstr : array[tllvmversion] of string[14] = (
  42. 'LLVM-3.3',
  43. 'LLVM-3.4.0',
  44. 'LLVM-3.4.1',
  45. 'LLVM-3.4.2',
  46. 'LLVM-3.5.0',
  47. 'LLVM-3.5.1',
  48. 'LLVM-3.5.2',
  49. 'LLVM-3.6.0',
  50. 'LLVM-3.6.1',
  51. 'LLVM-3.6.2',
  52. 'LLVM-Xcode-6.4'
  53. );
  54. llvmversion_properties: array[tllvmversion] of tllvmversionflags =
  55. (
  56. { llvmver_3_3 } [llvmflag_metadata_keyword,llvmflag_linker_private],
  57. { llvmver_3_4_0 } [llvmflag_metadata_keyword,llvmflag_linker_private],
  58. { llvmver_3_4_1 } [llvmflag_metadata_keyword,llvmflag_linker_private],
  59. { llvmver_3_4_2 } [llvmflag_metadata_keyword,llvmflag_linker_private],
  60. { llvmver_3_5_0 } [llvmflag_metadata_keyword],
  61. { llvmver_3_5_1 } [llvmflag_metadata_keyword],
  62. { llvmver_3_5_2 } [llvmflag_metadata_keyword],
  63. { llvmver_3_6_0 } [],
  64. { llvmver_3_6_1 } [],
  65. { llvmver_3_6_2 } [],
  66. { llvmver_xc_6_4 } [llvmflag_metadata_keyword]
  67. );
  68. { Supported optimizations, only used for information }
  69. supported_optimizerswitches = genericlevel1optimizerswitches+
  70. genericlevel2optimizerswitches+
  71. genericlevel3optimizerswitches-
  72. { no need to write info about those }
  73. [cs_opt_level1,cs_opt_level2,cs_opt_level3]+
  74. [cs_opt_loopunroll,cs_opt_nodecse];
  75. level1optimizerswitches = genericlevel1optimizerswitches;
  76. level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches + [cs_opt_nodecse];
  77. level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
  78. level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
  79. Implementation
  80. end.