[PATCH] D66122: [CodeGen] Emit dynamic initializers for static TLS vars in outlined scopes

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 20 15:51:47 PDT 2019


efriedma added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:479
+        return a_deps.find(b) != a_deps.end() 
+            || b->getLocation() < a->getLocation(); // ensure deterministic ordering
+      });
----------------
Is the call to a_deps.find() here actually necessary?  It shouldn't be possible for an initializer to directly refer to a variable declared later.

"<" on SourceLocations isn't source order, in general; you need isBeforeInTranslationUnit.  (This should be documented somewhere, but I'm not finding the documentation, unfortunately.  Any suggestions for where it should be documented?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66122





More information about the cfe-commits mailing list