svn commit: r311337 - in projects/clang400-import/contrib/llvm: include/llvm/Support lib/CodeGen/SelectionDAG tools/clang/include/clang/Basic tools/clang/include/clang/Sema tools/clang/lib/Sema
Dimitry Andric
dim at FreeBSD.org
Wed Jan 4 22:29:02 UTC 2017
Author: dim
Date: Wed Jan 4 22:29:00 2017
New Revision: 311337
URL: https://svnweb.freebsd.org/changeset/base/311337
Log:
Merge llvm, clang, lld and lldb trunk r291015, and resolve conflicts.
Modified:
projects/clang400-import/contrib/llvm/include/llvm/Support/FileSystem.h
projects/clang400-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
projects/clang400-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h
projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp
projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp
Directory Properties:
projects/clang400-import/contrib/llvm/ (props changed)
projects/clang400-import/contrib/llvm/tools/clang/ (props changed)
projects/clang400-import/contrib/llvm/tools/lld/ (props changed)
projects/clang400-import/contrib/llvm/tools/lldb/ (props changed)
Modified: projects/clang400-import/contrib/llvm/include/llvm/Support/FileSystem.h
==============================================================================
--- projects/clang400-import/contrib/llvm/include/llvm/Support/FileSystem.h Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/include/llvm/Support/FileSystem.h Wed Jan 4 22:29:00 2017 (r311337)
@@ -858,7 +858,7 @@ public:
// No operator++ because we need error_code.
recursive_directory_iterator &increment(std::error_code &ec) {
- const directory_iterator end_itr;
+ const directory_iterator end_itr = {};
if (State->HasNoPushRequest)
State->HasNoPushRequest = false;
@@ -905,7 +905,7 @@ public:
assert(State && "Cannot pop an end iterator!");
assert(State->Level > 0 && "Cannot pop an iterator with level < 1");
- const directory_iterator end_itr;
+ const directory_iterator end_itr = {};
std::error_code ec;
do {
if (ec)
Modified: projects/clang400-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
==============================================================================
--- projects/clang400-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jan 4 22:29:00 2017 (r311337)
@@ -428,7 +428,11 @@ SDValue DAGTypeLegalizer::PromoteIntRes_
// Assert that the converted value fits in the original type. If it doesn't
// (eg: because the value being converted is too big), then the result of the
// original operation was undefined anyway, so the assert is still correct.
- return DAG.getNode(NewOpc == ISD::FP_TO_UINT ?
+ //
+ // NOTE: fp-to-uint to fp-to-sint promotion guarantees zero extend. For example:
+ // before legalization: fp-to-uint16, 65534. -> 0xfffe
+ // after legalization: fp-to-sint32, 65534. -> 0x0000fffe
+ return DAG.getNode(N->getOpcode() == ISD::FP_TO_UINT ?
ISD::AssertZext : ISD::AssertSext, dl, NVT, Res,
DAG.getValueType(N->getValueType(0).getScalarType()));
}
Modified: projects/clang400-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 4 22:29:00 2017 (r311337)
@@ -3375,9 +3375,6 @@ def err_addrof_function_disabled_by_enab
"non-tautological enable_if conditions">;
def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
"candidate function made ineligible by enable_if">;
-def note_ovl_candidate_failed_overload_resolution : Note<
- "candidate template ignored: couldn't resolve reference to overloaded "
- "function %0">;
def note_ovl_candidate_deduced_mismatch : Note<
"candidate template ignored: deduced type "
"%diff{$ of %ordinal0 parameter does not match adjusted type $ of argument"
Modified: projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed Jan 4 22:29:00 2017 (r311337)
@@ -6576,9 +6576,6 @@ public:
/// \brief The explicitly-specified template arguments were not valid
/// template arguments for the given template.
TDK_InvalidExplicitArguments,
- /// \brief The arguments included an overloaded function name that could
- /// not be resolved to a suitable function.
- TDK_FailedOverloadResolution,
/// \brief Deduction failed; that's all we know.
TDK_MiscellaneousDeductionFailure,
/// \brief CUDA Target attributes do not match.
Modified: projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h Wed Jan 4 22:29:00 2017 (r311337)
@@ -53,7 +53,7 @@ class TemplateDeductionInfo {
public:
TemplateDeductionInfo(SourceLocation Loc, unsigned DeducedDepth = 0)
: Deduced(nullptr), Loc(Loc), HasSFINAEDiagnostic(false),
- DeducedDepth(DeducedDepth), Expression(nullptr) {}
+ DeducedDepth(DeducedDepth), CallArgIndex(0) {}
/// \brief Returns the location at which template argument is
/// occurring.
@@ -175,21 +175,12 @@ public:
/// FIXME: Finish documenting this.
TemplateArgument SecondArg;
- union {
- /// \brief The expression which caused a deduction failure.
- ///
- /// TDK_FailedOverloadResolution: this argument is the reference to
- /// an overloaded function which could not be resolved to a specific
- /// function.
- Expr *Expression;
-
- /// \brief The index of the function argument that caused a deduction
- /// failure.
- ///
- /// TDK_DeducedMismatch: this is the index of the argument that had a
- /// different argument type from its substituted parameter type.
- unsigned CallArgIndex;
- };
+ /// \brief The index of the function argument that caused a deduction
+ /// failure.
+ ///
+ /// TDK_DeducedMismatch: this is the index of the argument that had a
+ /// different argument type from its substituted parameter type.
+ unsigned CallArgIndex;
/// \brief Information on packs that we're currently expanding.
///
@@ -235,10 +226,6 @@ struct DeductionFailureInfo {
/// refers to, if any.
const TemplateArgument *getSecondArg();
- /// \brief Return the expression this deduction failure refers to,
- /// if any.
- Expr *getExpr();
-
/// \brief Return the index of the call argument that this deduction
/// failure refers to, if any.
llvm::Optional<unsigned> getCallArgIndex();
Modified: projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp Wed Jan 4 22:29:00 2017 (r311337)
@@ -644,10 +644,6 @@ clang::MakeDeductionFailureInfo(ASTConte
Result.HasDiagnostic = true;
}
break;
-
- case Sema::TDK_FailedOverloadResolution:
- Result.Data = Info.Expression;
- break;
}
return Result;
@@ -662,7 +658,6 @@ void DeductionFailureInfo::Destroy() {
case Sema::TDK_TooManyArguments:
case Sema::TDK_TooFewArguments:
case Sema::TDK_InvalidExplicitArguments:
- case Sema::TDK_FailedOverloadResolution:
case Sema::TDK_CUDATargetMismatch:
break;
@@ -705,7 +700,6 @@ TemplateParameter DeductionFailureInfo::
case Sema::TDK_SubstitutionFailure:
case Sema::TDK_DeducedMismatch:
case Sema::TDK_NonDeducedMismatch:
- case Sema::TDK_FailedOverloadResolution:
case Sema::TDK_CUDATargetMismatch:
return TemplateParameter();
@@ -737,7 +731,6 @@ TemplateArgumentList *DeductionFailureIn
case Sema::TDK_Inconsistent:
case Sema::TDK_Underqualified:
case Sema::TDK_NonDeducedMismatch:
- case Sema::TDK_FailedOverloadResolution:
case Sema::TDK_CUDATargetMismatch:
return nullptr;
@@ -765,7 +758,6 @@ const TemplateArgument *DeductionFailure
case Sema::TDK_TooFewArguments:
case Sema::TDK_InvalidExplicitArguments:
case Sema::TDK_SubstitutionFailure:
- case Sema::TDK_FailedOverloadResolution:
case Sema::TDK_CUDATargetMismatch:
return nullptr;
@@ -793,7 +785,6 @@ const TemplateArgument *DeductionFailure
case Sema::TDK_TooFewArguments:
case Sema::TDK_InvalidExplicitArguments:
case Sema::TDK_SubstitutionFailure:
- case Sema::TDK_FailedOverloadResolution:
case Sema::TDK_CUDATargetMismatch:
return nullptr;
@@ -811,14 +802,6 @@ const TemplateArgument *DeductionFailure
return nullptr;
}
-Expr *DeductionFailureInfo::getExpr() {
- if (static_cast<Sema::TemplateDeductionResult>(Result) ==
- Sema::TDK_FailedOverloadResolution)
- return static_cast<Expr*>(Data);
-
- return nullptr;
-}
-
llvm::Optional<unsigned> DeductionFailureInfo::getCallArgIndex() {
if (static_cast<Sema::TemplateDeductionResult>(Result) ==
Sema::TDK_DeducedMismatch)
@@ -9699,14 +9682,6 @@ static void DiagnoseBadDeduction(Sema &S
return;
}
- case Sema::TDK_FailedOverloadResolution: {
- OverloadExpr::FindResult R = OverloadExpr::find(DeductionFailure.getExpr());
- S.Diag(Templated->getLocation(),
- diag::note_ovl_candidate_failed_overload_resolution)
- << R.Expression->getName();
- return;
- }
-
case Sema::TDK_DeducedMismatch: {
// Format the template argument list into the argument string.
SmallString<128> TemplateArgString;
@@ -10043,7 +10018,6 @@ static unsigned RankDeductionFailure(con
return 3;
case Sema::TDK_InstantiationDepth:
- case Sema::TDK_FailedOverloadResolution:
return 4;
case Sema::TDK_InvalidExplicitArguments:
Modified: projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp Wed Jan 4 22:27:19 2017 (r311336)
+++ projects/clang400-import/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp Wed Jan 4 22:29:00 2017 (r311337)
@@ -3279,10 +3279,9 @@ DeduceTemplateArgumentByListElement(Sema
// For all other cases, just match by type.
QualType ArgType = Arg->getType();
if (AdjustFunctionParmAndArgTypesForDeduction(S, TemplateParams, ParamType,
- ArgType, Arg, TDF)) {
- Info.Expression = Arg;
- return Sema::TDK_FailedOverloadResolution;
- }
+ ArgType, Arg, TDF))
+ return Sema::TDK_Success;
+
return DeduceTemplateArgumentsByTypeMatch(S, TemplateParams, ParamType,
ArgType, Info, Deduced, TDF);
}
More information about the svn-src-projects
mailing list