[PATCH] D12263: Fix LLVM C API for DataLayout

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 22:38:21 PDT 2015


joker.eph created this revision.
joker.eph added a reviewer: echristo.
joker.eph added subscribers: llvm-commits, ributzka.

We removed access to the DataLayout on the TargetMachine and
deprecated the C API function LLVMGetTargetMachineData() in r243114.
However the way I tried to be backward compatible was broken: I
changed the wrapper of the TargetMachine to be a structure that
includes the DataLayout as well. However the TargetMachine is also
wrapped by the ExecutionEngine, in the more classic way. A client
using the TargetMachine wrapped by the ExecutionEngine and trying
to get the DataLayout would break.

It seems tricky to solve the problem completely in the C API
implementation. This patch tries to address this backward
compatibility in a more lighter way in the C++ API. The C API is
restored in its original state and the removed C++ API is
reintroduced, but privately. The C API is friended to the
TargetMachine and should be the only consumer for this API.

http://reviews.llvm.org/D12263

Files:
  include/llvm/Target/TargetMachine.h
  lib/Target/TargetMachineC.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12263.32898.patch
Type: text/x-patch
Size: 3259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150822/49dd2f05/attachment.bin>


More information about the llvm-commits mailing list