Page MenuHomePhabricator

[WIP][clang] Move deep copy into CompilerInvocation::clone
Changes PlannedPublic

Authored by jansvoboda11 on Wed, Apr 14, 3:19 AM.

Details

Summary

The copy constructor of CompilerInvocation performs a deep copy of the reference-counted pointers stored in its base class.

This behaviour might be surprising, since it doesn't follow the default semantics of std::shared_ptr and llvm::IntrusiveRefCntPtr.

In this patch, the copy constructor is declared private and the clone() method is introduced, making the behaviour obvious.

Depends on D100473.

WIP: Before landing this and advertising the deep copy functionality, we should clear up ownership of PreprocessorOptions::RemappedFileBuffers.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Wed, Apr 14, 3:19 AM
jansvoboda11 requested review of this revision.Wed, Apr 14, 3:19 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptWed, Apr 14, 3:19 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 planned changes to this revision.Wed, Apr 14, 3:25 AM
jansvoboda11 retitled this revision from [clang] Move deep copy into CompilerInvocation::clone to [WIP][clang] Move deep copy into CompilerInvocation::clone.
jansvoboda11 edited the summary of this revision. (Show Details)
jansvoboda11 planned changes to this revision.Fri, Apr 16, 2:32 AM

Rebase, delete RefBase copy assignment

jansvoboda11 planned changes to this revision.Mon, Apr 19, 6:46 AM