[PATCH] D29445: LTO: add a code-model flag

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 10:53:11 PST 2017


pcc added a comment.

In https://reviews.llvm.org/D29445#668858, @jhenderson wrote:

> In https://reviews.llvm.org/D29445#665768, @martell wrote:
>
> > To follow up with @jhenderson also about the unification on the switch statements.
> >  The same functionality also exists in clang in `lib/CodeGen/BackendUtil.cpp` in `EmitAssemblyHelper::CreateTargetMachine`
> >  Again suggestions on how best to unify would be greatly welcomed.
>
>
> Sorry for the delayed resposne. I don't know LLVM's layout well yet, but to me, the obvious place to put a function to do this would seem to be somewhere in the same library as where the enum is defined, i.e. the Support library of LLVM, (or possibly in the CodeGen library, since the enum is in CodeGen.h). Looking at the library I don't see an obvious candidate file though. Maybe it would be best to create a new one?
>
> With now four instances of identical functionality, something is bound to go wrong sooner or later, if we don't de-duplicate it.


As I have repeatedly mentioned, we can re-use the flag in CommandFlags.h.


https://reviews.llvm.org/D29445





More information about the llvm-commits mailing list