]> granicus.if.org Git - clang/commit
Emit section information for extern variables.
authorErich Keane <erich.keane@intel.com>
Tue, 26 Sep 2017 23:42:34 +0000 (23:42 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 26 Sep 2017 23:42:34 +0000 (23:42 +0000)
commit2dab9ecc4a8eba7b83700673007d3ce340e015d7
tree6b91891b5beedad3e06c93a633a9157b1b442486
parent13d3da81277f296969206cbfe2dc5191391f49c2
Emit section information for extern variables.

Currently, if _attribute_((section())) is used for extern variables,
section information is not emitted in generated IR when the variables are used.
This is expected since sections are not generated for external linkage objects.
However NiosII requires this information as it uses special GP-relative accesses
for any objects that use attribute section (.sdata). GCC keeps this attribute in
  middle-end.

This change emits the section information for all targets.

Patch By: Elizabeth Andrews

Differential Revision:https://reviews.llvm.org/D36487

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314262 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CodeGenModule.cpp
lib/Sema/SemaDecl.cpp
test/Sema/attr-section.c