aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-16 21:03:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-16 21:03:44 +0000
commit325377b57338e700317f5e423e5b0f1c08d99a39 (patch)
treeacd401a9713562cf3e93d13fa6a70ad67eb5cd99 /include
parent1b08b196ac845675036ac78f3ac927d0a37f707c (diff)
downloadsrc-325377b57338e700317f5e423e5b0f1c08d99a39.tar.gz
src-325377b57338e700317f5e423e5b0f1c08d99a39.zip
Vendor import of clang trunk r305575:vendor/clang/clang-trunk-r305575
Notes
Notes: svn path=/vendor/clang/dist/; revision=320015 svn path=/vendor/clang/clang-trunk-r305575/; revision=320016; tag=vendor/clang/clang-trunk-r305575
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/AllDiagnostics.h2
-rw-r--r--include/clang/Basic/BuiltinsPPC.def8
-rw-r--r--include/clang/Basic/DiagnosticSerializationKinds.td34
-rw-r--r--include/clang/Format/Format.h36
-rw-r--r--include/clang/Frontend/FrontendOptions.h4
-rw-r--r--include/clang/Lex/MacroArgs.h16
-rw-r--r--include/clang/Sema/Sema.h2
7 files changed, 83 insertions, 19 deletions
diff --git a/include/clang/Basic/AllDiagnostics.h b/include/clang/Basic/AllDiagnostics.h
index 18a2b8a31871..fc861a1952a5 100644
--- a/include/clang/Basic/AllDiagnostics.h
+++ b/include/clang/Basic/AllDiagnostics.h
@@ -28,7 +28,7 @@
namespace clang {
template <size_t SizeOfStr, typename FieldType>
class StringSizerHelper {
- char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
+ static_assert(SizeOfStr <= FieldType(~0U), "Field too small!");
public:
enum { Size = SizeOfStr };
};
diff --git a/include/clang/Basic/BuiltinsPPC.def b/include/clang/Basic/BuiltinsPPC.def
index 119490314b26..faa70a48edc3 100644
--- a/include/clang/Basic/BuiltinsPPC.def
+++ b/include/clang/Basic/BuiltinsPPC.def
@@ -51,10 +51,10 @@ BUILTIN(__builtin_altivec_vavguw, "V4UiV4UiV4Ui", "")
BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "")
-BUILTIN(__builtin_altivec_vcfsx, "V4fV4ii", "")
-BUILTIN(__builtin_altivec_vcfux, "V4fV4ii", "")
-BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fi", "")
-BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fi", "")
+BUILTIN(__builtin_altivec_vcfsx, "V4fV4iIi", "")
+BUILTIN(__builtin_altivec_vcfux, "V4fV4iIi", "")
+BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
+BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
BUILTIN(__builtin_altivec_dss, "vUi", "")
BUILTIN(__builtin_altivec_dssall, "v", "")
diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td
index 7c9e8c8980aa..0a59a633232c 100644
--- a/include/clang/Basic/DiagnosticSerializationKinds.td
+++ b/include/clang/Basic/DiagnosticSerializationKinds.td
@@ -121,10 +121,12 @@ def err_module_odr_violation_mismatch_decl : Error<
"%q0 has different definitions in different modules; first difference is "
"%select{definition in module '%2'|defined here}1 found "
"%select{end of class|public access specifier|private access specifier|"
- "protected access specifier|static assert|field|method}3">;
+ "protected access specifier|static assert|field|method|type alias|typedef|"
+ "data member}3">;
def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found "
"%select{end of class|public access specifier|private access specifier|"
- "protected access specifier|static assert|field|method}1">;
+ "protected access specifier|static assert|field|method|type alias|typedef|"
+ "data member}1">;
def err_module_odr_violation_mismatch_decl_diff : Error<
"%q0 has different definitions in different modules; first difference is "
@@ -149,7 +151,17 @@ def err_module_odr_violation_mismatch_decl_diff : Error<
"method %4 is %select{not inline|inline}5|"
"method %4 that has %5 parameter%s5|"
"method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|"
- "method %4 with %ordinal5 parameter named %6}3">;
+ "method %4 with %ordinal5 parameter named %6|"
+ "method %4 with %ordinal5 parameter with%select{out|}6 a default argument|"
+ "method %4 with %ordinal5 parameter with a default argument|"
+ "%select{typedef|type alias}4 name %5|"
+ "%select{typedef|type alias}4 %5 with underlying type %6|"
+ "data member with name %4|"
+ "data member %4 with type %5|"
+ "data member %4 with%select{out|}5 an initializer|"
+ "data member %4 with an initializer|"
+ "data member %4 %select{is constexpr|is not constexpr}5|"
+ "}3">;
def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found "
"%select{"
@@ -172,15 +184,27 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found "
"method %2 is %select{not inline|inline}3|"
"method %2 that has %3 parameter%s3|"
"method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|"
- "method %2 with %ordinal3 parameter named %4}1">;
+ "method %2 with %ordinal3 parameter named %4|"
+ "method %2 with %ordinal3 parameter with%select{out|}4 a default argument|"
+ "method %2 with %ordinal3 parameter with a different default argument|"
+ "%select{typedef|type alias}2 name %3|"
+ "%select{typedef|type alias}2 %3 with different underlying type %4|"
+ "data member with name %2|"
+ "data member %2 with different type %3|"
+ "data member %2 with%select{out|}3 an initializer|"
+ "data member %2 with a different initializer|"
+ "data member %2 %select{is constexpr|is not constexpr}3|"
+ "}1">;
def err_module_odr_violation_mismatch_decl_unknown : Error<
"%q0 %select{with definition in module '%2'|defined here}1 has different "
"definitions in different modules; first difference is this "
- "%select{||||static assert|field|method|unexpected decl}3">;
+ "%select{||||static assert|field|method|type alias|typedef|data member|"
+ "unexpected decl}3">;
def note_module_odr_violation_mismatch_decl_unknown : Note<
"but in '%0' found "
"%select{||||different static assert|different field|different method|"
+ "different type alias|different typedef|different data member|"
"another unexpected decl}1">;
def warn_duplicate_module_file_extension : Warning<
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h
index 7ec3e22ca4d7..1891c06eba51 100644
--- a/include/clang/Format/Format.h
+++ b/include/clang/Format/Format.h
@@ -688,6 +688,18 @@ struct FormatStyle {
bool BeforeElse;
/// \brief Indent the wrapped braces themselves.
bool IndentBraces;
+ /// \brief If ``false``, empty function body can be put on a single line.
+ /// This option is used only if the opening brace of the function has
+ /// already been wrapped, i.e. the `AfterFunction` brace wrapping mode is
+ /// set, and the function could/should not be put on a single line (as per
+ /// `AllowShortFunctionsOnASingleLine` and constructor formatting options).
+ /// \code
+ /// int f() vs. inf f()
+ /// {} {
+ /// }
+ /// \endcode
+ ///
+ bool SplitEmptyFunctionBody;
};
/// \brief Control of individual brace wrapping cases.
@@ -779,6 +791,29 @@ struct FormatStyle {
/// \endcode
bool BreakBeforeInheritanceComma;
+ /// \brief If ``true``, consecutive namespace declarations will be on the same
+ /// line. If ``false``, each namespace is declared on a new line.
+ /// \code
+ /// true:
+ /// namespace Foo { namespace Bar {
+ /// }}
+ ///
+ /// false:
+ /// namespace Foo {
+ /// namespace Bar {
+ /// }
+ /// }
+ /// \endcode
+ ///
+ /// If it does not fit on a single line, the overflowing namespaces get
+ /// wrapped:
+ /// \code
+ /// namespace Foo { namespace Bar {
+ /// namespace Extra {
+ /// }}}
+ /// \endcode
+ bool CompactNamespaces;
+
/// \brief If the constructor initializers don't fit on a line, put each
/// initializer on its own line.
/// \code
@@ -1410,6 +1445,7 @@ struct FormatStyle {
BreakBeforeBraces == R.BreakBeforeBraces &&
BreakBeforeTernaryOperators == R.BreakBeforeTernaryOperators &&
BreakConstructorInitializers == R.BreakConstructorInitializers &&
+ CompactNamespaces == R.CompactNamespaces &&
BreakAfterJavaFieldAnnotations == R.BreakAfterJavaFieldAnnotations &&
BreakStringLiterals == R.BreakStringLiterals &&
ColumnLimit == R.ColumnLimit && CommentPragmas == R.CommentPragmas &&
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h
index 36c046891b47..e757a7e397e3 100644
--- a/include/clang/Frontend/FrontendOptions.h
+++ b/include/clang/Frontend/FrontendOptions.h
@@ -317,8 +317,8 @@ public:
/// \brief Auxiliary triple for CUDA compilation.
std::string AuxTriple;
- /// \brief If non-empty, search the pch input file as it was a header
- // included by this file.
+ /// \brief If non-empty, search the pch input file as if it was a header
+ /// included by this file.
std::string FindPchSource;
/// Filename to write statistics to.
diff --git a/include/clang/Lex/MacroArgs.h b/include/clang/Lex/MacroArgs.h
index 7b2a48561ff6..cfe46ceb0979 100644
--- a/include/clang/Lex/MacroArgs.h
+++ b/include/clang/Lex/MacroArgs.h
@@ -53,9 +53,12 @@ class MacroArgs {
/// Preprocessor owns which we use to avoid thrashing malloc/free.
MacroArgs *ArgCache;
- MacroArgs(unsigned NumToks, bool varargsElided)
- : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
- ArgCache(nullptr) {}
+ /// MacroArgs - The number of arguments the invoked macro expects.
+ unsigned NumMacroArgs;
+
+ MacroArgs(unsigned NumToks, bool varargsElided, unsigned MacroArgs)
+ : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
+ ArgCache(nullptr), NumMacroArgs(MacroArgs) {}
~MacroArgs() = default;
public:
@@ -94,10 +97,9 @@ public:
SourceLocation ExpansionLocStart,
SourceLocation ExpansionLocEnd);
- /// getNumArguments - Return the number of arguments passed into this macro
- /// invocation.
- unsigned getNumArguments() const { return NumUnexpArgTokens; }
-
+ /// getNumMacroArguments - Return the number of arguments the invoked macro
+ /// expects.
+ unsigned getNumMacroArguments() const { return NumMacroArgs; }
/// isVarargsElidedUse - Return true if this is a C99 style varargs macro
/// invocation and there was no argument specified for the "..." argument. If
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 8025668e664e..1dedf4ba24ce 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -8364,6 +8364,8 @@ public:
//===--------------------------------------------------------------------===//
// C++ Coroutines TS
//
+ bool ActOnCoroutineBodyStart(Scope *S, SourceLocation KwLoc,
+ StringRef Keyword);
ExprResult ActOnCoawaitExpr(Scope *S, SourceLocation KwLoc, Expr *E);
ExprResult ActOnCoyieldExpr(Scope *S, SourceLocation KwLoc, Expr *E);
StmtResult ActOnCoreturnStmt(Scope *S, SourceLocation KwLoc, Expr *E);