Skip to content

Commit 84bf8ea

Browse files
authored
---
yaml --- r: 349217 b: refs/heads/master-next c: e5b31c4 h: refs/heads/master i: 349215: a536b9a
1 parent d064e95 commit 84bf8ea

File tree

119 files changed

+5967
-1190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+5967
-1190
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 633471c09264cf93d25824db87e8a46bcd69842b
3+
refs/heads/master-next: e5b31c4e1ec5986ae9aadad6297b1eb62af29bf2
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ function(_compile_swift_files
326326
set(sib_file "${module_base}.Onone.sib")
327327
set(sibopt_file "${module_base}.O.sib")
328328
set(sibgen_file "${module_base}.sibgen")
329-
list(APPEND swift_module_flags
330-
"-emit-module-source-info-path" "${source_info_file}")
331329

332330
if(SWIFT_ENABLE_MODULE_INTERFACES)
333331
set(interface_file "${module_base}.swiftinterface")
@@ -501,6 +499,7 @@ function(_compile_swift_files
501499
COMMAND
502500
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
503501
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
502+
"-emit-module-source-info-path" "${source_info_file}"
504503
${swift_flags} ${swift_module_flags} "@${file_path}"
505504
${command_touch_module_outputs}
506505
OUTPUT ${module_outputs}

branches/master-next/include/swift/AST/ASTTypeIDs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "swift/Basic/TypeID.h"
2222
namespace swift {
2323

24+
class AbstractFunctionDecl;
25+
class BraceStmt;
2426
class CustomAttr;
2527
class Decl;
2628
class GenericParamList;

branches/master-next/include/swift/AST/Decl.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5689,7 +5689,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56895689
/// Note that a true return value does not imply that the body was actually
56905690
/// parsed.
56915691
bool hasBody() const {
5692-
return getBodyKind() != BodyKind::None;
5692+
return getBodyKind() != BodyKind::None &&
5693+
getBodyKind() != BodyKind::Skipped;
56935694
}
56945695

56955696
/// Returns true if the text of this function's body can be retrieved either
@@ -5716,14 +5717,22 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57165717
/// Note that the body was skipped for this function. Function body
57175718
/// cannot be attached after this call.
57185719
void setBodySkipped(SourceRange bodyRange) {
5719-
assert(getBodyKind() == BodyKind::None);
5720+
// FIXME: Remove 'Parsed' from this once we can delay parsing function
5721+
// bodies. Right now -experimental-skip-non-inlinable-function-bodies
5722+
// requires being able to change the state from Parsed to Skipped,
5723+
// because we're still eagerly parsing function bodies.
5724+
assert(getBodyKind() == BodyKind::None ||
5725+
getBodyKind() == BodyKind::Unparsed ||
5726+
getBodyKind() == BodyKind::Parsed);
5727+
assert(bodyRange.isValid());
57205728
BodyRange = bodyRange;
57215729
setBodyKind(BodyKind::Skipped);
57225730
}
57235731

57245732
/// Note that parsing for the body was delayed.
57255733
void setBodyDelayed(SourceRange bodyRange) {
57265734
assert(getBodyKind() == BodyKind::None);
5735+
assert(bodyRange.isValid());
57275736
BodyRange = bodyRange;
57285737
setBodyKind(BodyKind::Unparsed);
57295738
}
@@ -5769,6 +5778,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57695778
return getBodyKind() == BodyKind::TypeChecked;
57705779
}
57715780

5781+
bool isBodySkipped() const {
5782+
return getBodyKind() == BodyKind::Skipped;
5783+
}
5784+
57725785
bool isMemberwiseInitializer() const {
57735786
return getBodyKind() == BodyKind::MemberwiseInitializer;
57745787
}
@@ -6329,9 +6342,7 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63296342

63306343
/// The raw value literal for the enum element, or null.
63316344
LiteralExpr *RawValueExpr;
6332-
/// The type-checked raw value expression.
6333-
Expr *TypeCheckedRawValueExpr = nullptr;
6334-
6345+
63356346
public:
63366347
EnumElementDecl(SourceLoc IdentifierLoc, DeclName Name,
63376348
ParameterList *Params,
@@ -6364,13 +6375,6 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63646375
bool hasRawValueExpr() const { return RawValueExpr; }
63656376
LiteralExpr *getRawValueExpr() const { return RawValueExpr; }
63666377
void setRawValueExpr(LiteralExpr *e) { RawValueExpr = e; }
6367-
6368-
Expr *getTypeCheckedRawValueExpr() const {
6369-
return TypeCheckedRawValueExpr;
6370-
}
6371-
void setTypeCheckedRawValueExpr(Expr *e) {
6372-
TypeCheckedRawValueExpr = e;
6373-
}
63746378

63756379
/// Return the containing EnumDecl.
63766380
EnumDecl *getParentEnum() const {

branches/master-next/include/swift/AST/DeclContext.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,15 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
409409
const_cast<DeclContext *>(this)->getInnermostDeclarationDeclContext();
410410
}
411411

412+
/// Returns the innermost context that is an AbstractFunctionDecl whose
413+
/// body has been skipped.
414+
LLVM_READONLY
415+
DeclContext *getInnermostSkippedFunctionContext();
416+
const DeclContext *getInnermostSkippedFunctionContext() const {
417+
return
418+
const_cast<DeclContext *>(this)->getInnermostSkippedFunctionContext();
419+
}
420+
412421
/// Returns the semantic parent of this context. A context has a
413422
/// parent if and only if it is not a module context.
414423
DeclContext *getParent() const {

branches/master-next/include/swift/AST/DiagnosticEngine.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
#ifndef SWIFT_BASIC_DIAGNOSTICENGINE_H
1919
#define SWIFT_BASIC_DIAGNOSTICENGINE_H
2020

21-
#include "swift/AST/Attr.h"
2221
#include "swift/AST/TypeLoc.h"
2322
#include "swift/AST/DeclNameLoc.h"
2423
#include "swift/AST/DiagnosticConsumer.h"
2524
#include "llvm/ADT/StringMap.h"
2625
#include "llvm/Support/Allocator.h"
26+
#include "llvm/Support/VersionTuple.h"
2727

2828
namespace swift {
2929
class Decl;
30+
class DeclAttribute;
3031
class DiagnosticEngine;
3132
class SourceManager;
3233
class ValueDecl;

branches/master-next/include/swift/AST/DiagnosticsFrontend.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ ERROR(error_mode_cannot_emit_module_source_info,none,
128128
"this mode does not support emitting module source info files", ())
129129
ERROR(error_mode_cannot_emit_interface,none,
130130
"this mode does not support emitting module interface files", ())
131+
ERROR(cannot_emit_ir_skipping_function_bodies,none,
132+
"-experimental-skip-non-inlinable-function-bodies does not support "
133+
"emitting IR", ())
131134

132135
WARNING(emit_reference_dependencies_without_primary_file,none,
133136
"ignoring -emit-reference-dependencies (requires -primary-file)", ())

branches/master-next/include/swift/AST/DiagnosticsSema.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ ERROR(missing_argument_named,none,
11161116
"missing argument for parameter %0 in call", (Identifier))
11171117
ERROR(missing_argument_positional,none,
11181118
"missing argument for parameter #%0 in call", (unsigned))
1119+
ERROR(missing_arguments_in_call,none,
1120+
"missing arguments for parameters %0 in call", (StringRef))
11191121
ERROR(extra_argument_named,none,
11201122
"extra argument %0 in call", (Identifier))
11211123
ERROR(extra_argument_positional,none,
@@ -3493,6 +3495,10 @@ ERROR(single_tuple_parameter_mismatch_normal,none,
34933495
(DescriptiveDeclKind, DeclBaseName, Type, StringRef))
34943496
ERROR(unknown_single_tuple_parameter_mismatch,none,
34953497
"single parameter of type %0 is expected in call", (Type))
3498+
ERROR(cannot_convert_single_tuple_into_multiple_arguments,none,
3499+
"%0 %select{%1 |}2expects %3 separate arguments"
3500+
"%select{|; remove extra parentheses to change tuple into separate arguments}4",
3501+
(DescriptiveDeclKind, DeclName, bool, unsigned, bool))
34963502

34973503
ERROR(enum_element_pattern_assoc_values_mismatch,none,
34983504
"pattern with associated values does not match enum case %0",

branches/master-next/include/swift/AST/Expr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
#include "swift/AST/CaptureInfo.h"
2121
#include "swift/AST/ConcreteDeclRef.h"
22+
#include "swift/AST/DeclContext.h"
2223
#include "swift/AST/DeclNameLoc.h"
2324
#include "swift/AST/FunctionRefKind.h"
2425
#include "swift/AST/ProtocolConformanceRef.h"
2526
#include "swift/AST/TrailingCallArguments.h"
2627
#include "swift/AST/TypeAlignments.h"
2728
#include "swift/AST/TypeLoc.h"
28-
#include "swift/AST/TypeRepr.h"
2929
#include "swift/AST/Availability.h"
3030
#include "swift/Basic/InlineBitfield.h"
3131
#include "llvm/Support/TrailingObjects.h"
@@ -40,7 +40,9 @@ namespace swift {
4040
class ArchetypeType;
4141
class ASTContext;
4242
class AvailabilitySpec;
43+
class IdentTypeRepr;
4344
class Type;
45+
class TypeRepr;
4446
class ValueDecl;
4547
class Decl;
4648
class DeclRefExpr;

branches/master-next/include/swift/AST/SILOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class SILOptions {
7070
/// Whether to stop the optimization pipeline after serializing SIL.
7171
bool StopOptimizationAfterSerialization = false;
7272

73+
/// Whether to skip emitting non-inlinable function bodies.
74+
bool SkipNonInlinableFunctionBodies = false;
75+
7376
/// Optimization mode being used.
7477
OptimizationMode OptMode = OptimizationMode::NotSet;
7578

branches/master-next/include/swift/Frontend/FrontendOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ class FrontendOptions {
180180
/// \sa swift::SharedTimer
181181
bool DebugTimeCompilation = false;
182182

183+
bool SkipNonInlinableFunctionBodies = false;
184+
183185
/// The path to which we should output statistics files.
184186
std::string StatsOutputDir;
185187

@@ -339,6 +341,7 @@ class FrontendOptions {
339341

340342
public:
341343
static bool doesActionGenerateSIL(ActionType);
344+
static bool doesActionGenerateIR(ActionType);
342345
static bool doesActionProduceOutput(ActionType);
343346
static bool doesActionProduceTextualOutput(ActionType);
344347
static bool needsProperModuleName(ActionType);

branches/master-next/include/swift/Option/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ def stats_output_dir: Separate<["-"], "stats-output-dir">,
254254
def trace_stats_events: Flag<["-"], "trace-stats-events">,
255255
Flags<[FrontendOption, HelpHidden]>,
256256
HelpText<"Trace changes to stats in -stats-output-dir">;
257+
def experimental_skip_non_inlinable_function_bodies:
258+
Flag<["-"], "experimental-skip-non-inlinable-function-bodies">,
259+
Flags<[FrontendOption, HelpHidden]>,
260+
HelpText<"Skip type-checking and SIL generation for non-inlinable function bodies">;
257261
def profile_stats_events: Flag<["-"], "profile-stats-events">,
258262
Flags<[FrontendOption, HelpHidden]>,
259263
HelpText<"Profile changes to stats in -stats-output-dir">;

branches/master-next/include/swift/Parse/ASTGen.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "llvm/ADT/DenseMap.h"
2222

2323
namespace swift {
24+
class ComponentIdentTypeRepr;
25+
class TupleTypeRepr;
26+
2427
/// Generates AST nodes from Syntax nodes.
2528
class Parser;
2629
class ASTGen {

branches/master-next/include/swift/Remote/MetadataReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ class MetadataReader {
869869
baseSize = sizeof(TargetAnonymousContextDescriptor<Runtime>);
870870
if (AnonymousContextDescriptorFlags(flags.getKindSpecificFlags())
871871
.hasMangledName()) {
872-
baseSize += sizeof(TargetMangledContextName<Runtime>);
872+
metadataInitSize = sizeof(TargetMangledContextName<Runtime>);
873873
}
874874
break;
875875
case ContextDescriptorKind::Class:

0 commit comments

Comments
 (0)