[PATCH] D36712: Emit section information for extern variables

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 14:53:27 PDT 2017

efriedma added inline comments.

Comment at: docs/LangRef.rst:629
+corresponding to the LLVM module, section information specified in the 
+declaration is retained in LLVM IR to enable OpenCL processes.
This doesn't really explain the part that matters. For LangRef, it doesn't matter how the frontend decides to generate declarations (and it might be different for frontends other than clang).  And OpenCL might motivate this, but it has nothing to do with the semantics.

The key question here is what it actually means.  Is it a promise the that a definition will exist for the given symbol in the given section?  If so, what happens if the symbol is actually in a different section?  ("Undefined behavior" is probably an acceptable answer, but it needs to be stated explicitly.)


More information about the cfe-commits mailing list