]> granicus.if.org Git - clang/commit
Add support for #pragma clang section
authorJaved Absar <javed.absar@arm.com>
Mon, 5 Jun 2017 10:11:57 +0000 (10:11 +0000)
committerJaved Absar <javed.absar@arm.com>
Mon, 5 Jun 2017 10:11:57 +0000 (10:11 +0000)
commit7c78710146c10e25cd149914210013905d70d6d6
tree68099d75a27c12fbc744658ed441e2e8abf1c591
parent6235d9b1ad493fbbd905e46b2b6afab52eeeb2cb
Add support for #pragma clang section

This patch provides a means to specify section-names for global variables,
functions and static variables, using #pragma directives.
This feature is only defined to work sensibly for ELF targets.
One can specify section names as:
#pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText"
One can "unspecify" a section name with empty string e.g.
#pragma clang section bss="" data="" text="" rodata=""

Reviewers: Roger Ferrer, Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D33412

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304705 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
docs/LanguageExtensions.rst
include/clang/Basic/Attr.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Parse/Parser.h
include/clang/Sema/Sema.h
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Parse/ParsePragma.cpp
lib/Sema/SemaAttr.cpp
lib/Sema/SemaDecl.cpp
test/CodeGenCXX/clang-sections-tentative.c [new file with mode: 0644]
test/CodeGenCXX/clang-sections.cpp [new file with mode: 0644]
test/Sema/pragma-clang-section.c [new file with mode: 0644]