Skip to content

Commit ed8491c

Browse files
committed
Revert "[TypeChecker] Add a flag to disable Double<->CGFloat implicit conversion"
This reverts commit 3c731d8.
1 parent 1f1a03c commit ed8491c

File tree

6 files changed

+0
-20
lines changed

6 files changed

+0
-20
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,6 @@ namespace swift {
592592

593593
/// See \ref FrontendOptions.PrintFullConvention
594594
bool PrintFullConvention = false;
595-
596-
/// Disallow Double and CGFloat types from being used interchangeably.
597-
bool DisableImplicitDoubleCGFloatConversion = false;
598595
};
599596

600597
/// Options for controlling the behavior of the Clang importer.

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
248248
// HIDDEN FLAGS
249249
let Flags = [FrontendOption, NoDriverOption, HelpHidden] in {
250250

251-
def disable_implicit_double_cgfloat_conversion : Flag<["-"], "disable-implicit-double-cgfloat-conversion">,
252-
HelpText<"Disable implicit conversion between Double and CGFloat types">;
253-
254251
def debug_constraints : Flag<["-"], "debug-constraints">,
255252
HelpText<"Debug the constraint-based type checker">;
256253

include/swift/Sema/ConstraintSystem.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,10 +1405,6 @@ enum class ConstraintSystemFlags {
14051405
/// calling conventions, say due to Clang attributes such as
14061406
/// `__attribute__((ns_consumed))`.
14071407
UseClangFunctionTypes = 0x80,
1408-
1409-
/// Disallow using Double and CGFloat interchangeably by means of
1410-
/// an implicit value conversion.
1411-
DisableImplicitDoubleCGFloatConversion = 0x100,
14121408
};
14131409

14141410
/// Options that affect the constraint system as a whole.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,6 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
830830
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
831831
Opts.DebugGenericSignatures |= Args.hasArg(OPT_debug_generic_signatures);
832832

833-
Opts.DisableImplicitDoubleCGFloatConversion |=
834-
Args.hasArg(OPT_disable_implicit_double_cgfloat_conversion);
835-
836833
for (const Arg *A : Args.filtered(OPT_debug_constraints_on_line)) {
837834
unsigned line;
838835
if (StringRef(A->getValue()).getAsInteger(/*radix*/ 10, line)) {

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5131,10 +5131,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
51315131
nominal1->getDecl() != nominal2->getDecl() &&
51325132
((nominal1->isCGFloatType() || nominal2->isCGFloatType()) &&
51335133
(nominal1->isDoubleType() || nominal2->isDoubleType()))) {
5134-
if (Options.contains(
5135-
ConstraintSystemFlags::DisableImplicitDoubleCGFloatConversion))
5136-
return getTypeMatchFailure(locator);
5137-
51385134
// Support implicit Double<->CGFloat conversions only for
51395135
// something which could be directly represented in the AST
51405136
// e.g. argument-to-parameter, contextual conversions etc.

lib/Sema/ConstraintSystem.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ ConstraintSystem::ConstraintSystem(DeclContext *dc,
8888
}
8989
if (Context.LangOpts.UseClangFunctionTypes)
9090
Options |= ConstraintSystemFlags::UseClangFunctionTypes;
91-
92-
if (Context.TypeCheckerOpts.DisableImplicitDoubleCGFloatConversion)
93-
Options |= ConstraintSystemFlags::DisableImplicitDoubleCGFloatConversion;
9491
}
9592

9693
ConstraintSystem::~ConstraintSystem() {

0 commit comments

Comments
 (0)