Merge branch 'master' into master-next

# Conflicts:
#	utils/build-script-impl
This commit is contained in:
Karoy Lorentey
2019-05-29 16:29:40 -07:00
4 changed files with 32 additions and 4 deletions

View File

@@ -4685,6 +4685,9 @@ public:
SourceRange getSourceRange() const { return Loc; } SourceRange getSourceRange() const { return Loc; }
TypeLoc &getTypeLoc() { return PlaceholderTy; } TypeLoc &getTypeLoc() { return PlaceholderTy; }
TypeLoc getTypeLoc() const { return PlaceholderTy; } TypeLoc getTypeLoc() const { return PlaceholderTy; }
SourceLoc getTrailingAngleBracketLoc() const {
return Loc.getAdvancedLoc(Placeholder.getLength() - 1);
}
/// The TypeRepr to be considered for placeholder expansion. /// The TypeRepr to be considered for placeholder expansion.
TypeRepr *getTypeForExpansion() const { return ExpansionTyR; } TypeRepr *getTypeForExpansion() const { return ExpansionTyR; }

View File

@@ -2635,7 +2635,19 @@ public:
PrintWithColorRAII(OS, ParenthesisColor) << ')'; PrintWithColorRAII(OS, ParenthesisColor) << ')';
} }
void visitEditorPlaceholderExpr(EditorPlaceholderExpr *E) { void visitEditorPlaceholderExpr(EditorPlaceholderExpr *E) {
printCommon(E, "editor_placeholder_expr") << '\n'; printCommon(E, "editor_placeholder_expr") << ' ';
// Print the trailing angle bracket location
if (auto Ty = GetTypeOfExpr(E)) {
auto &Ctx = Ty->getASTContext();
auto TABL = E->getTrailingAngleBracketLoc();
if (TABL.isValid()) {
PrintWithColorRAII(OS, LocationColor) << " trailing_angle_bracket_loc=";
TABL.print(PrintWithColorRAII(OS, LocationColor).getOS(),
Ctx.SourceMgr);
}
}
OS << '\n';
auto *TyR = E->getTypeLoc().getTypeRepr(); auto *TyR = E->getTypeLoc().getTypeRepr();
auto *ExpTyR = E->getTypeForExpansion(); auto *ExpTyR = E->getTypeForExpansion();
if (TyR) if (TyR)

View File

@@ -2,7 +2,10 @@
func string_interpolation() { func string_interpolation() {
"\("abc")" "\("abc")"
<#Int#>
} }
// RUN: %target-swift-frontend -dump-ast %s | %FileCheck %s // RUN: not %target-swift-frontend -dump-ast %s | %FileCheck %s
// CHECK: (interpolated_string_literal_expr {{.*}} trailing_quote_loc=SOURCE_DIR{{/|\\}}test{{/|\\}}Parse{{/|\\}}source_locs.swift:4:12 {{.*}} // CHECK: (interpolated_string_literal_expr {{.*}} trailing_quote_loc=SOURCE_DIR{{/|\\}}test{{/|\\}}Parse{{/|\\}}source_locs.swift:4:12 {{.*}}
// CHECK: (editor_placeholder_expr type='()' {{.*}} trailing_angle_bracket_loc=SOURCE_DIR{{/|\\}}test{{/|\\}}Parse{{/|\\}}source_locs.swift:5:9

View File

@@ -2153,8 +2153,18 @@ for host in "${ALL_HOSTS[@]}"; do
fi fi
if [ "${SKIP_BUILD_LLVM}" ] ; then if [ "${SKIP_BUILD_LLVM}" ] ; then
# We can't skip the build completely because the standalone # We can't skip the build completely because the standalone
# build of Swift depend on these for testing etc. # build of Swift depend on these for building and testing.
build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets FileCheck not) build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets)
# If we are not performing a toolchain only build, then we
# also want to include FileCheck and not for testing
# purposes.
if [[ ! "${BUILD_TOOLCHAIN_ONLY}" ]] ; then
build_targets=(
"${build_targets[@]}"
FileCheck
not
)
fi
fi fi
if [ "${HOST_LIBTOOL}" ] ; then if [ "${HOST_LIBTOOL}" ] ; then