[PATCH] Some code improvements (no functional change)
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Apr 29 10:34:12 PDT 2014
On 2014-Apr-17, at 4:35, Artyom Skrobov <Artyom.Skrobov at arm.com> wrote:
>> I think this one is definitely out, though. The C API is stable, so
>> we'd have to support this forever. And you're putting C++ code into it,
>> which is probably just wrong.
>>
>> If you can find an appropriate place in include/llvm/, maybe?
>
> Duncan, perhaps include/llvm/IR/DataLayout.h is a good place for this?
Yes, this looks better. Send the full patch and I'll have another look.
> --- a/include/llvm/IR/DataLayout.h
> +++ b/include/llvm/IR/DataLayout.h
> @@ -445,6 +445,16 @@ public:
> }
> };
>
> +typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
> +
> +inline DataLayout *unwrap(LLVMTargetDataRef P) {
> + return reinterpret_cast<DataLayout*>(P);
> +}
> +
> +inline LLVMTargetDataRef wrap(const DataLayout *P) {
> + return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
> +}
> +
> class DataLayoutPass : public ImmutablePass {
> DataLayout DL;
>
> --
> That's together with the same changes in lib/Target/Target.cpp,
> lib/Target/TargetMachineC.cpp,
> lib/ExecutionEngine/ExecutionEngineBindings.cpp as in the original patch.
>
>
>
>
More information about the llvm-commits
mailing list