This revision was automatically updated to reflect the committed changes.
Closed by commit rL314262: Emit section information for extern variables.
(authored by erichkeane).
Changed prior to commit:
https://reviews.llvm.org/D36487?vs=116581&id=116739#toc
Repository:
rL LLVM
https://reviews
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
https://reviews.llvm.org/D36487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/c
eandrews updated this revision to Diff 116581.
eandrews added a comment.
I've modified the patch to emit a warning for re-declarations only. I also
removed the isUsed check.
https://reviews.llvm.org/D36487
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CodeGenModule.cpp
li
efriedma added a comment.
> Should I restrict the warning to just redeclarations (without definition)
> instead?
I think just redeclarations. The pattern of a declaration without a section
followed by a definition with a section is common, and not really harmful.
Comment at
eandrews added inline comments.
Comment at: lib/CodeGen/CodeGenModule.cpp:2434
+// Emit section information for extern variables.
+if (D->hasExternalStorage() && !D->isThisDeclarationADefinition()) {
+ if (const SectionAttr *SA = D->getAttr())
efried
eandrews updated this revision to Diff 116211.
eandrews added a comment.
I've updated the patch based on review comments. The changes include setting
section unconditionally for extern variables and emitting a warning if section
attribute is specified on a redeclaration.
https://reviews.llvm.o
efriedma added inline comments.
Comment at: lib/CodeGen/CodeGenModule.cpp:2434
+// Emit section information for extern variables.
+if (D->hasExternalStorage() && !D->isThisDeclarationADefinition()) {
+ if (const SectionAttr *SA = D->getAttr())
eandre
erichkeane added a comment.
Hey @efriedma : Did you get a chance to take a look at this? She got the
langref changes in, so it is just waiting on this.
https://reviews.llvm.org/D36487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http:/
eandrews added a comment.
*ping*
https://reviews.llvm.org/D36487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eandrews added a comment.
LangRef has been updated and accepted. You can find it here -
https://reviews.llvm.org/rL311459
https://reviews.llvm.org/D36487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/
erichkeane added a comment.
@efriedma : LangRef changed in this review: https://reviews.llvm.org/D36712
https://reviews.llvm.org/D36487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
eandrews updated this revision to Diff 111064.
eandrews added a comment.
As per review comments, removed extra RUNS in lit test.
https://reviews.llvm.org/D36487
Files:
lib/CodeGen/CodeGenModule.cpp
test/CodeGenCXX/extern-section-attribute.cpp
Index: test/CodeGenCXX/extern-section-attribut
eandrews added inline comments.
Comment at: lib/CodeGen/CodeGenModule.cpp:2434
+// Emit section information for extern variables.
+if (D->hasExternalStorage() && !D->isThisDeclarationADefinition()) {
+ if (const SectionAttr *SA = D->getAttr())
efried
efriedma added inline comments.
Comment at: lib/CodeGen/CodeGenModule.cpp:2434
+// Emit section information for extern variables.
+if (D->hasExternalStorage() && !D->isThisDeclarationADefinition()) {
+ if (const SectionAttr *SA = D->getAttr())
Why do
efriedma added a comment.
Please propose a patch for LangRef clarifying what exactly it means to have a
section attribute on a declaration.
Comment at: test/CodeGenCXX/extern-section-attribute.cpp:1
+// RUN: %clang_cc1 -emit-llvm %s -o - -ffreestanding -triple=i386-pc-linux-gn
eandrews created this revision.
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 info
16 matches
Mail list logo