LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 18885 - -fms-extensions should implement MSVC's section pragmas (const_seg, data_seg, etc)
Summary: -fms-extensions should implement MSVC's section pragmas (const_seg, data_seg,...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks: 13707 18887
  Show dependency tree
 
Reported: 2014-02-18 12:17 PST by Reid Kleckner
Modified: 2014-08-11 11:52 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reid Kleckner 2014-02-18 12:17:46 PST
The relevant MSDN docs:
http://msdn.microsoft.com/en-us/library/1dc22465.aspx

The grammar:
#pragma const_seg( [ [ { push | pop}, ] [ identifier, ] ] [ "segment-name" [, "segment-class" ] )

This is important because it's used to register initializers and finalizers similar to __attribute__((section(".init_array"))) in ELF.

David says that we'll have to extend LLVM IR to encode the section properties such as readonly, executable, initialized, etc.
Comment 2 Reid Kleckner 2014-08-11 11:52:19 PDT
Warren implemented most of these back in r205810.

I implemented #pragma init_seg in r213593, but the code in Blink turned out to be bogus anyway because it was declaring a const globals without a user-declared constructor.  We ended up rewriting the Blink code to use statically initialized const references to some uninitialized storage.
Comment 3 Reid Kleckner 2014-08-11 11:52:54 PDT
(In reply to comment #2)
> Warren implemented most of these back in r205810.
> 
> I implemented #pragma init_seg in r213593, but the code in Blink turned out
> to be bogus anyway because it was declaring a const globals without a
> user-declared constructor.  We ended up rewriting the Blink code to use
> statically initialized const references to some uninitialized storage.

Really closing...