Skip to content

Commit 53b4d87

Browse files
author
whitequark
committedAug 19, 2015
LLVMIRGenerator: attach debug metadata to all emitted LLVM instructions.
1 parent 51c591f commit 53b4d87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

Diff for: ‎artiq/compiler/transforms/llvm_ir_generator.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,14 @@ def process_function(self, func):
387387
for block in func.basic_blocks:
388388
self.llbuilder.position_at_end(self.llmap[block])
389389
for insn in block.instructions:
390+
if insn.loc is not None:
391+
self.llbuilder.debug_metadata = \
392+
self.debug_info_emitter.emit_loc(insn.loc, disubprogram)
393+
390394
llinsn = getattr(self, "process_" + type(insn).__name__)(insn)
391395
assert llinsn is not None
392396
self.llmap[insn] = llinsn
393397

394-
if insn.loc is not None and not isinstance(llinsn, ll.Constant):
395-
diloc = self.debug_info_emitter.emit_loc(insn.loc, disubprogram)
396-
llinsn.set_metadata('dbg', diloc)
397-
398398
# There is no 1:1 correspondence between ARTIQ and LLVM
399399
# basic blocks, because sometimes we expand a single ARTIQ
400400
# instruction so that the result spans several LLVM basic

0 commit comments

Comments
 (0)
Please sign in to comment.