[PATCH] D43095: Make attribute-target on a Definition-after-use update the LLVM attributes
Eric Christopher via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 12 09:09:52 PST 2018
echristo added inline comments.
================
Comment at: lib/CodeGen/CodeGenModule.cpp:1318-1325
+ llvm::AttrBuilder Attrs;
+ if (GetCPUAndFeaturesAttributes(D, Attrs)) {
+ // We know that GetCPUAndFeaturesAttributes will always have the
+ // newest set, since it has the newest possible FunctionDecl, so the
+ // new ones should replace the old.
+ F->removeFnAttr("target-cpu");
+ F->removeFnAttr("target-features");
----------------
erichkeane wrote:
> echristo wrote:
> > This feels awkward here. On a quick glance I'm not sure why we need this if we're adding above... is it possible to delay in such a way that we're not trying to add twice?
> I hadn't seen any. The other call happens only on a declaration, this happens only on definition. There doesn't really seem to be a way to tell if something is GOING to be defined later, since we often emit the declaration immediately.
OK, sounds good. I didn't have any other feedback here :)
Repository:
rC Clang
https://reviews.llvm.org/D43095
More information about the cfe-commits
mailing list