This is an archive of the discontinued LLVM Phabricator instance.

A step towards getting libclang tests working on Windows
AbandonedPublic

Authored by yaron.keren on Jul 5 2015, 1:21 PM.

Details

Reviewers
rnk
doug.gregor
Summary

One of the problems libclang tests has running under Windows is memory malloced in libclang.dll being but freed in the test executable, possibly by a different memory manager. This patch exposes a new export function, clang_free(), used to free this malloced memory with the same libclang.dll memory manager that malloced the memory.

Diff Detail

Repository
rL LLVM

Event Timeline

yaron.keren updated this revision to Diff 29056.Jul 5 2015, 1:21 PM
yaron.keren retitled this revision from to A step towards getting libclang tests working on Windows.
yaron.keren updated this object.
yaron.keren set the repository for this revision to rL LLVM.
yaron.keren added subscribers: cfe-commits, rnk, chapuni.
doug.gregor requested changes to this revision.Jul 6 2015, 8:52 AM
doug.gregor added a reviewer: doug.gregor.
doug.gregor added a subscriber: doug.gregor.

It would be fantastic to get these tests running on Windows (and make libclang more usable on Windows in general).

tools/clang/include/clang-c/BuildSystem.h
92

Let's make this more general: make it take a "void *", and be used for anything that the library allocates from the normal heap that must later be freed.

This revision now requires changes to proceed.Jul 6 2015, 8:52 AM
rnk added inline comments.Jul 6 2015, 9:19 AM
tools/clang/include/clang-c/BuildSystem.h
92

out_buffer_ptr doesn't make sense as a parameter name; it is not an out param. Probably 'buffer' or something is fine.

yaron.keren edited edge metadata.

Changed type, name of input argument of clang_free and its description.

rnk accepted this revision.Jul 8 2015, 5:01 PM
rnk added a reviewer: rnk.

lgtm

yaron.keren abandoned this revision.Jul 9 2015, 1:37 AM

Committed revision 241789.

Phabricator does not let me close this for some reason so I abandon it to close.