Skip to content

Instantly share code, notes, and snippets.

View modocache's full-sized avatar

Brian Gesiak modocache

View GitHub Profile
# When I want to attach lldb to swiftc to see how it works when compiling simple Swift programs:
utils/build-script \
--release --debug-swift \
--build-swift-dynamic-stdlib=0 --build-swift-dynamic-sdk-overlay=0 \
--skip-build-osx --skip-build-ios --skip-build-tvos --skip-build-watchos
# When I want to run the Swift test suite, to make sure my pull request would pass CI:
utils/build-script \
--release --debug-swift \
--test
* thread #1: tid = 0x92c452, 0x00000001010d10a3 swift`swift::importer::NameImporter::importNameImpl(this=0x000000010f909c90, D=0x000000011104fb30, version=Swift3) + 435 at ImportName.cpp:1122, queue = 'com.apple.main-thread', stop reason = step over
* frame #0: 0x00000001010d10a3 swift`swift::importer::NameImporter::importNameImpl(this=0x000000010f909c90, D=0x000000011104fb30, version=Swift3) + 435 at ImportName.cpp:1122
frame #1: 0x00000001010d5d53 swift`swift::importer::NameImporter::importName(this=0x000000010f909c90, decl=0x000000011104fb30, version=Swift3) + 291 at ImportName.cpp:1641
frame #2: 0x000000010104c67d swift`swift::ClangImporter::Implementation::importFullName(this=0x000000010f019e00, D=0x000000011104fb30, version=Swift3) + 61 at ImporterImpl.h:632
frame #3: 0x000000010105cd8c swift`(anonymous namespace)::SwiftDeclConverter::importFullName(this=0x00007fff5fbef908, D=0x000000011104fb30, correctSwiftName=0x00007fff5fbef788) + 204 at ImportDecl.cpp:1694
frame #4: 0x0000000101077
C:\Users\bgesiak\src\llvm\llvm (master)
λ python utils\lit\lit.py -v --path C:\Users\bgesiak\src\llvm\build-vs\Debug\bin\ utils\lit\tests
lit.py: C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\lit.cfg:50: note: Found python psutil module
-- Testing: 19 tests, 4 threads --
FAIL: lit :: discovery.py (1 of 19)
******************** TEST 'lit :: discovery.py' FAILED ********************
Script:
--
C:\tools\python2\python.exe C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\..\lit.py C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\..\tests\Inputs/discovery -j 1 --debug --show-tests --show-suites -v > C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\Output\discovery.py.tmp.out 2> C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\Output\discovery.py.tmp.err
FileCheck --check-prefix=CHECK-BASIC-OUT < C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\Output\discovery.py.tmp.out C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\discovery.py
$ utils/build-script --release
+ mkdir -p /data/users/bgesiak/GitHub/apple/build/Ninja-ReleaseAssert
+ env HOST_VARIABLE_linux_x86_64__SWIFT_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_RUN_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_SDKS=LINUX HOST_VARIABLE_linux_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-linux-x86_64 HOST_VARIABLE_linux_x86_64__SWIFT_TEST_TARGETS= /data/users/bgesiak/GitHub/apple/swift/utils/build-script-impl --workspace /data/users/bgesiak/GitHub/apple --build-dir /data/users/bgesiak/GitHub/apple/build/Ninja-ReleaseAssert --install-prefix /usr --host-target linux-x86_64 --stdlib-deployment-targets linux-x86_64 --host-cc /usr/local/bin/clang --host-cxx /usr/local/bin/clang++ --darwin-xcrun-toolchain default --darwin-deployment-version-osx=10.9 --darwin-deployment-version-ios=7.0 --darwin-deployment-version-tvos=9.0 --darwin-deployment-version-watchos=2.0 --cmake /bin/cmake --cmark-build-type Release --llvm-build-type Release --swift-build-type Release --swift-stdlib-bui
utils/build-script --release
+ mkdir -p /data/users/bgesiak/GitHub/apple/build/Ninja-ReleaseAssert
+ env HOST_VARIABLE_linux_x86_64__SWIFT_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_RUN_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_SDKS=LINUX HOST_VARIABLE_linux_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-linux-x86_64 HOST_VARIABLE_linux_x86_64__SWIFT_TEST_TARGETS= /data/users/bgesiak/GitHub/apple/swift/utils/build-script-impl --workspace /data/users/bgesiak/GitHub/apple --build-dir /data/users/bgesiak/GitHub/apple/build/Ninja-ReleaseAssert --install-prefix /usr --host-target linux-x86_64 --stdlib-deployment-targets linux-x86_64 --host-cc /data/users/bgesiak/GitHub/modocache/llvm-build/bin/clang --host-cxx /data/users/bgesiak/GitHub/modocache/llvm-build/bin/clang++ --darwin-xcrun-toolchain default --darwin-deployment-version-osx=10.9 --darwin-deployment-version-ios=7.0 --darwin-deployment-version-tvos=9.0 --darwin-deployment-version-watchos=2.0 --cmake /bin/cmake --cmark-build-type Release
$ time xcodebuild -showsdks
iOS SDKs:
iOS 10.1 -sdk iphoneos10.1
iOS Simulator SDKs:
Simulator - iOS 10.1 -sdk iphonesimulator10.1
macOS SDKs:
macOS 10.12 -sdk macosx10.12
@modocache
modocache / CompilationPerformance.md
Last active November 24, 2016 10:17
Graydon Hoare's advice on diagnosing compile performance, from https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20161031/003410.html

Compilation performance

This document describes a systematic method for detection, isolation, correction and prevention of regression, on matters of compiler performance. The method focuses on the creation of small end-to-end scaling tests that characterize, and stand in for, larger codebases on which the compiler is seen to perform poorly. These scaling tests have a number of advantages over "full sized" performance-testing codebases:

www.viva64.com/en/w 1 err Help: The documentation for all analyzer warnings is available here: http://www.viva64.com/en/w/.
/home/modocache/GitHub/apple/llvm/include/llvm/ADT/None.h 23 err V573 Uninitialized variable 'None' was used. The variable was used to initialize itself.
/home/modocache/GitHub/apple/llvm/include/llvm/ADT/STLExtras.h 215 err V510 The 'f' function is not expected to receive class-type variable as first actual argument.
/home/modocache/GitHub/apple/llvm/include/llvm/Support/Memory.h 160 note V690 The 'OwningMemoryBlock' class implements the '=' operator, but lacks a copy constructor. It is dangerous to use such a class.
/home/modocache/GitHub/apple/llvm/include/llvm/Support/Allocator.h 135 note V690 The 'BumpPtrAllocatorImpl' class implements the '=' operator, but lacks a copy constructor. It is dangerous to use such a class.
/home/modocache/GitHub/apple/llvm/include/llvm/Support/Allocator.h 365 note V690 The 'SpecificBumpPtrAllocator' class implements the '=' operator, but lacks a copy co
clang -### hi.c
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" "-cc1" "-triple" "x86_64-apple-macosx10.12.0" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-mrelax-all" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "hi.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-munwind-tables" "-target-cpu" "penryn" "-target-linker-version" "274.1" "-dwarf-column-info" "-debugger-tuning=lldb" "-resource-dir" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0" "-fdebug-compilation-dir" "/Users/bgesiak/GitHub/tmp" "-ferror-limit" "19" "-fmessage-length" "358" "-stack-protector" "1" "-fblocks" "-fobj
@modocache
modocache / typehints-lit-main.diff
Created October 10, 2016 00:07
Type hints that satisfy `mypy --py2 --silent-imports --strict-optional utils/lit/lit/main.py`
diff --git a/utils/lit/lit/ProgressBar.py b/utils/lit/lit/ProgressBar.py
index 3ad704d..e05bd7c 100644
--- a/utils/lit/lit/ProgressBar.py
+++ b/utils/lit/lit/ProgressBar.py
@@ -167,7 +167,17 @@ class TerminalController:
# Example use case: progress bar
#######################################################################
-class SimpleProgressBar:
+class ProgressBarBase(object):