[LLVMdev] ExecutionEngine::updateGlobalMapping

Manny Ko Manny.Ko at imgtec.com
Thu Apr 4 10:47:48 PDT 2013


Hello,

I am using updateGlobalMapping to inform the JIT engine the address of some C helpers. Due to the nature of the analysis pass, there can be several calls to updateGlobalMapping with the same GlobalValue key and the same (or sometimes different) address.

My problem is when the reverse mapping is enabled, the following fragment:

  // If we are using the reverse mapping, add it too.
  if (!EEState.getGlobalAddressReverseMap(locked).empty()) {
    AssertingVH<const GlobalValue> &V =
      EEState.getGlobalAddressReverseMap(locked)[Addr];
    assert((V == 0 || GV == 0) && "GlobalMapping already established!");
    V = GV;
  }

Will assert even though the update of the reverse map, if allowed to execute, is exactly has I will like to see.  The comments for updateGlobalMapping suggest this is supposed to be a valid operation.

I worked around it by removing the previous mapping first but that seems a little inefficient and not elegant.

PS: I tried to use addGlobalMapping too.

Manny

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130404/7f314d92/attachment.html>


More information about the llvm-dev mailing list