]> granicus.if.org Git - clang/commit
-fms-extensions: Implement half of #pragma init_seg
authorReid Kleckner <reid@kleckner.net>
Tue, 22 Jul 2014 00:53:05 +0000 (00:53 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 22 Jul 2014 00:53:05 +0000 (00:53 +0000)
commite6de71dffb8ce404e22505f0e80015137437fde9
treedca670a4c974afefaebbf2eb76e9f77e312ebbbd
parent8a16cb111295cbb321a40788d8ea83e9c240d803
-fms-extensions: Implement half of #pragma init_seg

Summary:
This pragma is very rare.  We could *hypothetically* lower some uses of
it down to @llvm.global_ctors, but given that GlobalOpt isn't able to
optimize prioritized global ctors today, there's really no point.

If we wanted to do this in the future, I would check if the section used
in the pragma started with ".CRT$XC" and had up to two characters after
it.  Those two characters could form the 16-bit initialization priority
that we support in @llvm.global_ctors.  We would have to teach LLVM to
lower prioritized global ctors on COFF as well.

This should let us compile some silly uses of this pragma in WebKit /
Blink.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4549

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213593 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Parse/Parser.h
include/clang/Sema/Sema.h
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenModule.h
lib/Parse/ParsePragma.cpp
lib/Parse/Parser.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaAttr.cpp
lib/Sema/SemaDecl.cpp
test/CodeGenCXX/pragma-init_seg.cpp
test/SemaCXX/pragma-init_seg.cpp [new file with mode: 0644]