Skip to content

Commit d9a7a7d

Browse files
Revert "[Printer] Conditionally print Clang types in emitted SIL."
This reverts commit a27c5f0.
1 parent 13f7ac2 commit d9a7a7d

File tree

15 files changed

+37
-86
lines changed

15 files changed

+37
-86
lines changed

include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ struct PrintOptions {
564564
static PrintOptions printDocInterface();
565565

566566
/// Retrieve the set of options suitable for printing SIL functions.
567-
static PrintOptions printSIL(bool printFullConvention = false) {
567+
static PrintOptions printSIL() {
568568
PrintOptions result;
569569
result.PrintLongAttrsOnSeparateLines = true;
570570
result.PrintStorageRepresentationAttrs = true;
@@ -575,9 +575,6 @@ struct PrintOptions {
575575
result.PrintIfConfig = false;
576576
result.OpaqueReturnTypePrinting =
577577
OpaqueReturnTypePrintingMode::StableReference;
578-
if (printFullConvention)
579-
result.PrintFunctionRepresentationAttrs =
580-
PrintOptions::FunctionRepresentationMode::Full;
581578
return result;
582579
}
583580

include/swift/AST/SILOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ class SILOptions {
7878
/// variables by name when we print it out. This eases diffing of SIL files.
7979
bool EmitSortedSIL = false;
8080

81-
/// See \ref FrontendOptions.PrintFullConvention
82-
bool PrintFullConvention = false;
83-
8481
/// Whether to stop the optimization pipeline after serializing SIL.
8582
bool StopOptimizationAfterSerialization = false;
8683

include/swift/Frontend/FrontendOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ class FrontendOptions {
253253
/// See the \ref SILOptions.EmitSortedSIL flag.
254254
bool EmitSortedSIL = false;
255255

256-
/// Should we emit the cType when printing @convention(c) or no?
257-
bool PrintFullConvention = false;
258-
259256
/// Indicates whether the dependency tracker should track system
260257
/// dependencies as well.
261258
bool TrackSystemDeps = false;

include/swift/Frontend/ModuleInterfaceSupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct ModuleInterfaceOptions {
3131
/// interface, or should we fully-qualify them?
3232
bool PreserveTypesAsWritten = false;
3333

34-
/// See \ref FrontendOptions.PrintFullConvention.
35-
/// FIXME: [clang-function-type-serialization] This flag should go away.
34+
/// Should we emit the cType when printing @convention(c) or no?
35+
/// FIXME: [clang-function-type-serialization] This check should go away.
3636
bool PrintFullConvention = false;
3737

3838
/// Copy of all the command-line flags passed at .swiftinterface

include/swift/Option/FrontendOptions.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,10 @@ def module_interface_preserve_types_as_written :
608608
HelpText<"When emitting a module interface, preserve types as they were "
609609
"written in the source">;
610610

611-
// FIXME: [clang-function-type-serialization] Make this a SIL-only option once we
612-
// start unconditionally emitting non-canonical Clang types in swiftinterfaces.
613611
def experimental_print_full_convention :
614612
Flag<["-"], "experimental-print-full-convention">,
615-
HelpText<"When emitting a module interface or SIL, emit additional @convention"
616-
" arguments, regardless of whether they were written in the source">;
613+
HelpText<"When emitting a module interface, emit additional @convention "
614+
"arguments, regardless of whether they were written in the source">;
617615

618616
def prebuilt_module_cache_path :
619617
Separate<["-"], "prebuilt-module-cache-path">,

include/swift/SIL/SILModule.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,10 @@ class SILModule {
644644
/// printed. The module would usually contain the types and Decls that
645645
/// the SIL module depends on.
646646
/// \param PrintASTDecls If set to true print AST decls.
647-
void print(raw_ostream &OS,
648-
ModuleDecl *M = nullptr,
649-
const SILOptions &Opts = SILOptions(),
647+
void print(raw_ostream &OS, bool Verbose = false,
648+
ModuleDecl *M = nullptr, bool ShouldSort = false,
650649
bool PrintASTDecls = true) const {
651-
SILPrintContext PrintCtx(OS, Opts);
650+
SILPrintContext PrintCtx(OS, Verbose, ShouldSort);
652651
print(PrintCtx, M, PrintASTDecls);
653652
}
654653

include/swift/SIL/SILPrintContext.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef SWIFT_SIL_PRINTCONTEXT_H
1414
#define SWIFT_SIL_PRINTCONTEXT_H
1515

16-
#include "swift/AST/SILOptions.h"
1716
#include "swift/SIL/SILDebugScope.h"
1817
#include "swift/SIL/SILValue.h"
1918
#include "llvm/ADT/DenseMap.h"
@@ -66,21 +65,13 @@ class SILPrintContext {
6665
/// Print debug locations and scopes.
6766
bool DebugInfo;
6867

69-
/// See \ref FrontendOptions.PrintFullConvention.
70-
bool PrintFullConvention;
71-
7268
public:
7369
/// Constructor with default values for options.
7470
///
7571
/// DebugInfo will be set according to the -sil-print-debuginfo option.
7672
SILPrintContext(llvm::raw_ostream &OS, bool Verbose = false,
7773
bool SortedSIL = false);
7874

79-
/// Constructor based on SILOptions.
80-
///
81-
/// DebugInfo will be set according to the -sil-print-debuginfo option.
82-
SILPrintContext(llvm::raw_ostream &OS, const SILOptions &Opts);
83-
8475
SILPrintContext(llvm::raw_ostream &OS, bool Verbose,
8576
bool SortedSIL, bool DebugInfo);
8677

@@ -103,9 +94,6 @@ class SILPrintContext {
10394
/// Returns true if debug locations and scopes should be printed.
10495
bool printDebugInfo() const { return DebugInfo; }
10596

106-
/// Returns true if the entire @convention(c, cType: ..) should be printed.
107-
bool printFullConvention() const { return PrintFullConvention; }
108-
10997
SILPrintContext::ID getID(const SILBasicBlock *Block);
11098

11199
SILPrintContext::ID getID(const SILNode *node);

include/swift/SIL/SILType.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,7 @@ class SILType {
581581

582582
std::string getAsString() const;
583583
void dump() const;
584-
void print(raw_ostream &OS,
585-
const PrintOptions &PO = PrintOptions::printSIL()) const;
584+
void print(raw_ostream &OS) const;
586585
};
587586

588587
// Statically prevent SILTypes from being directly cast to a type

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ bool ArgsToFrontendOptionsConverter::convert(
6868

6969
Opts.EmitVerboseSIL |= Args.hasArg(OPT_emit_verbose_sil);
7070
Opts.EmitSortedSIL |= Args.hasArg(OPT_emit_sorted_sil);
71-
Opts.PrintFullConvention |=
72-
Args.hasArg(OPT_experimental_print_full_convention);
7371

7472
Opts.EnableTesting |= Args.hasArg(OPT_enable_testing);
7573
Opts.EnablePrivateImports |= Args.hasArg(OPT_enable_private_imports);

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
964964
Opts.DebugSerialization |= Args.hasArg(OPT_sil_debug_serialization);
965965
Opts.EmitVerboseSIL |= Args.hasArg(OPT_emit_verbose_sil);
966966
Opts.EmitSortedSIL |= Args.hasArg(OPT_emit_sorted_sil);
967-
Opts.PrintFullConvention |=
968-
Args.hasArg(OPT_experimental_print_full_convention);
969967
Opts.PrintInstCounts |= Args.hasArg(OPT_print_inst_counts);
970968
if (const Arg *A = Args.getLastArg(OPT_external_pass_pipeline_filename))
971969
Opts.ExternalPassPipelineFilename = A->getValue();

0 commit comments

Comments
 (0)