[PATCH] D53446: Set MAttrs in LTO mode

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 13:10:35 PDT 2018


ruiu added inline comments.


================
Comment at: Common/TargetOptionsCommandFlags.cpp:38
+  std::vector<std::string> Attrs;
+  for (std::string &Attr : MAttrs)
+    Attrs.push_back(Attr);
----------------
ruiu wrote:
> yinma wrote:
> > ruiu wrote:
> > > yinma wrote:
> > > > ruiu wrote:
> > > > > Where is this `MAttrs` defined?
> > > > Those can be set by commend line options
> > > But I can't find that code in this patch. Is that is another patch?
> > I see what you are asking for. it is defined in LLVM.
> > 
> > include/llvm/CodeGen/CommandFlags.inc:40:    MAttrs("mattr", cl::CommaSeparated,
> > 
> Oh, I missed that. So `MAttrs` is not even in any namespace? Not sure if that is a good practice. Anyway, please add a comment saying that "MAttrs is defined in llvm/CodeGen/CommandFlags.inc."
> 
> I believe you can simply return MAttrs from this function.
Or, maybe the easiest way of writing this function is just this:

  std::vector<std::string> lld::GetMAttrs() { return ::MAttrs; }  


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53446





More information about the llvm-commits mailing list