Skip to content

Commit

Permalink
LLVMIRGenerator: attach debug metadata to all emitted LLVM instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Aug 19, 2015
1 parent 51c591f commit 53b4d87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions artiq/compiler/transforms/llvm_ir_generator.py
Expand Up @@ -387,14 +387,14 @@ def process_function(self, func):
for block in func.basic_blocks:
self.llbuilder.position_at_end(self.llmap[block])
for insn in block.instructions:
if insn.loc is not None:
self.llbuilder.debug_metadata = \
self.debug_info_emitter.emit_loc(insn.loc, disubprogram)

llinsn = getattr(self, "process_" + type(insn).__name__)(insn)
assert llinsn is not None
self.llmap[insn] = llinsn

if insn.loc is not None and not isinstance(llinsn, ll.Constant):
diloc = self.debug_info_emitter.emit_loc(insn.loc, disubprogram)
llinsn.set_metadata('dbg', diloc)

# There is no 1:1 correspondence between ARTIQ and LLVM
# basic blocks, because sometimes we expand a single ARTIQ
# instruction so that the result spans several LLVM basic
Expand Down

0 comments on commit 53b4d87

Please sign in to comment.