[PATCH] D99568: [clang][invocation] Fix copy constructor, add copy assignment to CompilerInvocation

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 30 02:05:12 PDT 2021


jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The `CompilerInvocationBase` class factors out members of `CompilerInvocation` that need special handling (initialization or copy constructor), so that `CompilerInvocation` can be implemented as a simple value object.

Currently, the `AnalyzerOpts` member of `CompilerInvocation` violates that setup. This patch extracts the member to `CompilerInvocationBase` and handles it in the copy constructor the same way other it handles other members.

Moreover, this patch adds a copy-assignment operator to `CompilerInvocationBase`, making the whole `CompilerInvocation` copy-assignable. This will prove useful in a follow-up patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99568

Files:
  clang/include/clang/Frontend/CompilerInvocation.h
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/unittests/Frontend/CompilerInvocationTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99568.334078.patch
Type: text/x-patch
Size: 4506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210330/0c0f9b42/attachment-0001.bin>


More information about the cfe-commits mailing list