summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/Basic/Attr.td12
-rw-r--r--clang/include/clang/Basic/AttrDocs.td16
-rw-r--r--clang/include/clang/Basic/DiagnosticParseKinds.td3
-rw-r--r--clang/include/clang/Parse/Parser.h2
-rw-r--r--clang/include/clang/Sema/Sema.h8
5 files changed, 40 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 62bb1ddb7f3..704a375ba29 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1767,6 +1767,18 @@ def MSVtorDisp : InheritableAttr {
let Documentation = [Undocumented];
}
+def InitSeg : Attr {
+ let Spellings = [Pragma<"", "init_seg">];
+ let Args = [StringArgument<"Section">];
+ let SemaHandler = 0;
+ let Documentation = [InitSegDocs];
+ let AdditionalMembers = [{
+ void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const {
+ OS << '(' << getSection() << ')';
+ }
+ }];
+}
+
def Unaligned : IgnoredAttr {
let Spellings = [Keyword<"__unaligned">];
}
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index 97002320277..e6d6a33d3b5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -36,6 +36,22 @@ global variable or function should be in after translation.
let Heading = "section (gnu::section, __declspec(allocate))";
}
+def InitSegDocs : Documentation {
+ let Category = DocCatVariable;
+ let Content = [{
+The attribute applied by ``pragma init_seg()`` controls the section into
+which global initialization function pointers are emitted. It is only
+available with ``-fms-extensions``. Typically, this function pointer is
+emitted into ``.CRT$XCU`` on Windows. The user can change the order of
+initialization by using a different section name with the same
+``.CRT$XC`` prefix and a suffix that sorts lexicographically before or
+after the standard ``.CRT$XCU`` sections. See the init_seg_
+documentation on MSDN for more information.
+
+.. _init_seg: http://msdn.microsoft.com/en-us/library/7977wcck(v=vs.110).aspx
+ }];
+}
+
def TLSModelDocs : Documentation {
let Category = DocCatVariable;
let Content = [{
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
index af0baebc131..35ed795c9fd 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -800,6 +800,9 @@ def warn_pragma_expected_section_push_pop_or_name : Warning<
def warn_pragma_expected_section_label_or_name : Warning<
"expected a stack label or a string literal for the section name in '#pragma %0' - ignored">,
InGroup<IgnoredPragmas>;
+def warn_pragma_expected_init_seg : Warning<
+ "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_expected_integer : Warning<
"expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
InGroup<IgnoredPragmas>;
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 73bef66c2ce..c58c41a44c5 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -725,7 +725,7 @@ private:
/// returned.
bool ExpectAndConsume(tok::TokenKind ExpectedTok,
unsigned Diag = diag::err_expected,
- const char *DiagMsg = "");
+ StringRef DiagMsg = "");
/// \brief The parser expects a semicolon and, if present, will consume it.
///
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 43fa508ad40..83488d0a6a6 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -330,6 +330,10 @@ public:
PragmaStack<StringLiteral *> ConstSegStack;
PragmaStack<StringLiteral *> CodeSegStack;
+ /// Last section used with #pragma init_seg.
+ StringLiteral *CurInitSeg;
+ SourceLocation CurInitSegLoc;
+
/// VisContext - Manages the stack for \#pragma GCC visibility.
void *VisContext; // Really a "PragmaVisStack*"
@@ -7179,6 +7183,10 @@ public:
void ActOnPragmaMSSection(SourceLocation PragmaLocation,
int SectionFlags, StringLiteral *SegmentName);
+ /// \brief Called on well-formed \#pragma init_seg().
+ void ActOnPragmaMSInitSeg(SourceLocation PragmaLocation,
+ StringLiteral *SegmentName);
+
/// ActOnPragmaDetectMismatch - Call on well-formed \#pragma detect_mismatch
void ActOnPragmaDetectMismatch(StringRef Name, StringRef Value);
OpenPOWER on IntegriCloud