Class: Comet::Rules::Codegen
- Inherits:
-
Object
- Object
- Comet::Rules::Codegen
- Defined in:
- lib/comet/rules/codegen.rb
Instance Method Summary collapse
- #commands ⇒ Object
- #contents ⇒ Object
-
#initialize(linker, bitcode) ⇒ Codegen
constructor
A new instance of Codegen.
- #rules ⇒ Object
- #target ⇒ Object
Constructor Details
#initialize(linker, bitcode) ⇒ Codegen
Returns a new instance of Codegen.
4 5 6 7 |
# File 'lib/comet/rules/codegen.rb', line 4 def initialize(linker, bitcode) @linker = linker @bitcode = bitcode end |
Instance Method Details
#commands ⇒ Object
31 32 33 |
# File 'lib/comet/rules/codegen.rb', line 31 def commands { COMET_OPT: 'clang' } end |
#contents ⇒ Object
20 21 22 23 24 25 |
# File 'lib/comet/rules/codegen.rb', line 20 def contents [ "#{target}: #{@bitcode.target} | #{Comet::TMPDIR}", "\t#{llvm_codegen} -o $@ $<" ] end |
#rules ⇒ Object
27 28 29 |
# File 'lib/comet/rules/codegen.rb', line 27 def rules @rules ||= [@bitcode] end |
#target ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/comet/rules/codegen.rb', line 9 def target @target ||= Comet::Makefile.fingerprint Hash[ command: clang_link_command, target: @bitcode.target, triple: @linker.triple, isa: @linker.isa, cpu: @linker.cpu, opt: @linker.opt ], extension: :s end |