Skip to content

Commit d825276

Browse files
Ross Bayermikeash
authored andcommitted
---
yaml --- r: 348900 b: refs/heads/master c: e40a6fd h: refs/heads/master
1 parent 5c02690 commit d825276

File tree

4 files changed

+18
-79
lines changed

4 files changed

+18
-79
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f2229c481139c847ea4c38da025e2752e44c9d05
2+
refs/heads/master: e40a6fd42d0eae6afee2fd380d6ee2d7c9fa1d9b
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/SIL/SILProfiler.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ struct MapRegionCounters : public ASTWalker {
247247
if (skipExpr(E))
248248
return {true, E};
249249

250-
// Profiling for closures should be handled separately. Do not visit
251-
// closure expressions twice.
252-
if (isa<AbstractClosureExpr>(E) && !Parent.isNull())
253-
return {false, E};
254-
255250
// If AST visitation begins with an expression, the counter map must be
256251
// empty. Set up a counter for the root.
257252
if (Parent.isNull()) {
@@ -435,20 +430,6 @@ class SourceMappingRegion {
435430
assert(EndLoc && "Region has no end location");
436431
return *EndLoc;
437432
}
438-
439-
void print(llvm::raw_ostream &OS, const SourceManager &SM) const {
440-
OS << "[";
441-
if (hasStartLoc())
442-
getStartLoc().print(OS, SM);
443-
else
444-
OS << "?";
445-
OS << ", ";
446-
if (hasEndLoc())
447-
getEndLoc().print(OS, SM);
448-
else
449-
OS << "?";
450-
OS << "]";
451-
}
452433
};
453434

454435
/// An ASTWalker that maps ASTNodes to profiling counters.
@@ -610,11 +591,6 @@ struct PGOMapping : public ASTWalker {
610591
if (skipExpr(E))
611592
return {true, E};
612593

613-
// Profiling for closures should be handled separately. Do not visit
614-
// closure expressions twice.
615-
if (isa<AbstractClosureExpr>(E) && !Parent.isNull())
616-
return {false, E};
617-
618594
unsigned parent = getParentCounter();
619595

620596
if (Parent.isNull()) {
@@ -778,11 +754,6 @@ struct CoverageMapping : public ASTWalker {
778754
void pushRegion(ASTNode Node) {
779755
RegionStack.emplace_back(Node, getCounter(Node), Node.getStartLoc(),
780756
getEndLoc(Node));
781-
LLVM_DEBUG({
782-
llvm::dbgs() << "Pushed region: ";
783-
RegionStack.back().print(llvm::dbgs(), SM);
784-
llvm::dbgs() << "\n";
785-
});
786757
}
787758

788759
/// Replace the current region's count by pushing an incomplete region.
@@ -809,8 +780,6 @@ struct CoverageMapping : public ASTWalker {
809780
auto ParentIt = I;
810781
SourceLoc EndLoc = ParentIt->getEndLoc();
811782

812-
unsigned FirstPoppedIndex = SourceRegions.size();
813-
(void)FirstPoppedIndex;
814783
SourceRegions.push_back(std::move(*I++));
815784
for (; I != E; ++I) {
816785
if (!I->hasStartLoc())
@@ -820,14 +789,6 @@ struct CoverageMapping : public ASTWalker {
820789
SourceRegions.push_back(std::move(*I));
821790
}
822791

823-
LLVM_DEBUG({
824-
for (unsigned Idx = FirstPoppedIndex; Idx < SourceRegions.size(); ++Idx) {
825-
llvm::dbgs() << "Popped region: ";
826-
SourceRegions[Idx].print(llvm::dbgs(), SM);
827-
llvm::dbgs() << "\n";
828-
}
829-
});
830-
831792
RegionStack.erase(ParentIt, E);
832793
}
833794

@@ -1056,11 +1017,6 @@ struct CoverageMapping : public ASTWalker {
10561017
if (skipExpr(E))
10571018
return {true, E};
10581019

1059-
// Profiling for closures should be handled separately. Do not visit
1060-
// closure expressions twice.
1061-
if (isa<AbstractClosureExpr>(E) && !Parent.isNull())
1062-
return {false, E};
1063-
10641020
if (!RegionStack.empty())
10651021
extendRegion(E);
10661022

trunk/test/Profiler/coverage_empty_region_stack1.swift

Lines changed: 0 additions & 20 deletions
This file was deleted.

trunk/utils/build-script-impl

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,24 +2927,27 @@ for host in "${ALL_HOSTS[@]}"; do
29272927
# When we are building LLVM copy over the compiler-rt
29282928
# builtins for iOS/tvOS/watchOS to ensure that Swift's
29292929
# stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
2930-
if [[ "${product}" == "llvm" && "${BUILD_LLVM}" == "1" ]]; then
2931-
if [[ "$(uname -s)" == "Darwin" ]] ; then
2932-
HOST_CXX_DIR=$(dirname "${HOST_CXX}")
2933-
DEST_CXX_BUILTINS_VERSION=$(ls "$(build_directory_bin ${host} llvm)/../lib/clang" | awk '{print $0}')
2930+
if [[ "${product}" = "llvm" ]] && [[ "${BUILD_LLVM}" = "1" ]] && [[ "$(uname -s)" = "Darwin" ]]; then
2931+
HOST_CXX_DIR=$(dirname "${HOST_CXX}")
2932+
HOST_LIB_CLANG_DIR="${HOST_CXX_DIR}/../lib/clang"
2933+
DEST_LIB_CLANG_DIR="$(build_directory_bin ${host} llvm)/../lib/clang"
2934+
2935+
if [[ -d "${HOST_LIB_CLANG_DIR}" ]] && [[ -d "${DEST_LIB_CLANG_DIR}" ]]; then
2936+
DEST_CXX_BUILTINS_VERSION=$(ls "${DEST_LIB_CLANG_DIR}" | awk '{print $0}')
29342937
DEST_BUILTINS_DIR="$(build_directory_bin ${host} llvm)/../lib/clang/$DEST_CXX_BUILTINS_VERSION/lib/darwin"
29352938

2936-
if [ -d "$DEST_BUILTINS_DIR" ]; then
2937-
for HOST_CXX_BUILTINS_PATH in "$HOST_CXX_DIR/../lib/clang"/*; do
2938-
HOST_CXX_BUILTINS_DIR="$HOST_CXX_BUILTINS_PATH/lib/darwin"
2939-
echo "copying compiler-rt embedded builtins from $HOST_CXX_BUILTINS_DIR into the local clang build directory $DEST_BUILTINS_DIR."
2939+
if [[ -d "${DEST_BUILTINS_DIR}" ]]; then
2940+
for HOST_CXX_BUILTINS_PATH in "${HOST_LIB_CLANG_DIR}"/*; do
2941+
HOST_CXX_BUILTINS_DIR="${HOST_CXX_BUILTINS_PATH}/lib/darwin"
2942+
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."
29402943

29412944
for OS in ios watchos tvos; do
29422945
LIB_NAME="libclang_rt.$OS.a"
29432946
HOST_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$LIB_NAME"
2944-
if [ -f "$HOST_LIB_PATH" ]; then
2945-
call cp "$HOST_LIB_PATH" "$DEST_BUILTINS_DIR/$LIB_NAME"
2947+
if [[ -f "${HOST_LIB_PATH}" ]]; then
2948+
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${LIB_NAME}"
29462949
elif [[ "${VERBOSE_BUILD}" ]]; then
2947-
echo "no file exists at $HOST_LIB_PATH"
2950+
echo "no file exists at ${HOST_LIB_PATH}"
29482951
fi
29492952
done
29502953
done
@@ -3445,7 +3448,7 @@ for host in "${ALL_HOSTS[@]}"; do
34453448
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
34463449
# We don't have a toolchain so we should install to the specified dir
34473450
DYLIB_DIR="${INSTALL_DESTDIR}"
3448-
MODULE_DIR="${INSTALL_DESTDIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
3451+
MODULE_DIR="${INSTALL_DESTDIR}"
34493452
# Create the install dir if it doesn't exist
34503453
call mkdir -p "${INSTALL_DESTDIR}"
34513454
# Install libParser is necessary
@@ -3455,14 +3458,14 @@ for host in "${ALL_HOSTS[@]}"; do
34553458
else
34563459
# We have a toolchain so install to the toolchain
34573460
DYLIB_DIR="${host_install_destdir}${host_install_prefix}/lib/swift/${SWIFT_HOST_VARIANT}"
3458-
MODULE_DIR="${DYLIB_DIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
3461+
MODULE_DIR="${DYLIB_DIR}/${SWIFT_HOST_VARIANT_ARCH}"
34593462
fi
34603463
if [[ "${SKIP_SWIFTSYNTAX_SWIFTSIDE}" ]]; then
34613464
continue
34623465
fi
34633466
set_swiftsyntax_build_command
34643467
if [[ -z "${SKIP_INSTALL_SWIFTSYNTAX_MODULE}" ]] ; then
3465-
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-base-name "${MODULE_DIR}" --install
3468+
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-dir "${MODULE_DIR}" --install
34663469
else
34673470
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
34683471
fi

0 commit comments

Comments
 (0)