[PATCH] D59509: Make static constructors + destructors minsize + cold (except for in -O0)

James Y Knight via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 03:22:54 PDT 2019


jyknight added a comment.

Looks reasonable to me.



================
Comment at: clang/test/CodeGen/static-attr.cpp:4
+
+// WITHOUT-NOT: cold minsize noinline
+// WITH: define internal void @__cxx_global_var_init() [[ATTR:#[0-9]]]
----------------
lebedev.ri wrote:
> This is fragile, it may have false-negative if they appear in other order.
I think we guarantee it's emitted in the same order, but it's certainly the case that nobody will ever notice if this is failing to fail the test, if other attributes get emitted in between in the future.

You can use 3 separate WITHOUT-NOT lines, instead, to avoid both of this kind of issue.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59509/new/

https://reviews.llvm.org/D59509





More information about the cfe-commits mailing list