Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Moiseev committed Mar 8, 2016
2 parents 7fe6916 + 4b86ad2 commit 1fae0d1
Show file tree
Hide file tree
Showing 144 changed files with 3,098 additions and 2,092 deletions.
2 changes: 1 addition & 1 deletion .pep8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
filename = *.py,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,gyb,line-directive,ns-html2rst,recursive-lipo,rth,submit-benchmark-results,update-checkout,viewcfg
ignore = E101,E111,E128,E265,E302,E402,E501,W191
ignore = D100,D101,D102,D103,D104,D105,E101,E111,E128,E302,E402,E501,W191
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Swift 3
-------

* Generic typealiases are now supported, e.g.:
typealias StringDictionary<T> = Dictionary<String, T>
typealias IntFunction<T> = (T) -> Int
typealias MatchingTriple<T> = (T, T, T)
typealias BackwardTriple<T1,T2,T3> = (T3, T2, T1)

etc.

* The @noescape attribute has been extended to be a more general type attribute.
You can now declare values of @noescape function type, e.g. in manually
curried function signatures. You can now also declare local variables of
Expand Down
4 changes: 2 additions & 2 deletions benchmark/scripts/Benchmark_DTrace.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#
# ===----------------------------------------------------------------------===//

import argparse
import os
import sys
import subprocess
import argparse
import sys

DRIVER_LIBRARY_PATH = "@PATH_TO_DRIVER_LIBRARY@"
sys.path.append(DRIVER_LIBRARY_PATH)
Expand Down
20 changes: 10 additions & 10 deletions benchmark/scripts/Benchmark_Driver
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
#
# ===----------------------------------------------------------------------===//

import subprocess
import sys
import argparse
import datetime
import glob
import json
import os
import re
import json
import urllib2
import urllib
import datetime
import argparse
import subprocess
import sys
import time
import glob
import urllib
import urllib2

DRIVER_DIR = os.path.dirname(os.path.realpath(__file__))

Expand Down Expand Up @@ -128,7 +128,7 @@ def log_results(log_directory, driver, formatted_output, swift_repo=None):
"""
try:
branch = get_current_git_branch(swift_repo)
except:
except (OSError, subprocess.CalledProcessError):
branch = None
timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime())
if branch:
Expand All @@ -138,7 +138,7 @@ def log_results(log_directory, driver, formatted_output, swift_repo=None):
driver_name = os.path.basename(driver)
try:
os.makedirs(output_directory)
except:
except OSError:
pass
log_file = os.path.join(output_directory,
driver_name + '-' + timestamp + '.log')
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_GuardMalloc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# ===----------------------------------------------------------------------===//

import os
import sys
import subprocess
import sys

sys.path.append("@PATH_TO_DRIVER_LIBRARY@")

Expand Down
8 changes: 4 additions & 4 deletions benchmark/scripts/Benchmark_RuntimeLeaksRunner.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#
# ===----------------------------------------------------------------------===//

import os
import sys
import json
import os
import subprocess
import sys

sys.path.append("@PATH_TO_DRIVER_LIBRARY@")

Expand Down Expand Up @@ -77,7 +77,7 @@ class LeaksRunnerBenchmarkDriver(perf_test_driver.BenchmarkDriver):
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
error_out = p.stderr.readlines()
except:
except OSError:
print("Child Process Failed! (%s,%s)" % (data['path'], data['test_name']))
return LeaksRunnerResult(test_name, True)

Expand All @@ -94,7 +94,7 @@ class LeaksRunnerBenchmarkDriver(perf_test_driver.BenchmarkDriver):
d['objc_count'] -= FUNC_TO_GLOBAL_COUNTS[data['test_name']]['objc_count']

return LeaksRunnerResult(test_name, (d['objc_count'] + d['swift_count']) > 0)
except:
except (KeyError, ValueError):
print "Failed parse output! (%s,%s)" % (data['path'], data['test_name'])
return LeaksRunnerResult(test_name, True)

Expand Down
4 changes: 2 additions & 2 deletions benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# repeat.sh 3 mypatch/bin/Benchmark_Driver run -o -O > mypatch.O.times
# compare_perf_tests.py tot.O.times mypatch.O.times | sort -t, -n -k 6 | column -s, -t

import sys
import re
import sys

VERBOSE = 0

Expand All @@ -38,7 +38,7 @@
def parse_int(word):
try:
return int(word)
except:
except ValueError:
raise Exception("Expected integer value, not " + word)

def get_scores(fname):
Expand Down
5 changes: 3 additions & 2 deletions benchmark/scripts/generate_harness/generate_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

# Generate CMakeLists.txt and utils/main.swift from templates.

import jinja2
import os
import glob
import os
import re

import jinja2

script_dir = os.path.dirname(os.path.realpath(__file__))
perf_dir = os.path.realpath(os.path.join(script_dir, '../..'))
single_source_dir = os.path.join(perf_dir, 'single-source')
Expand Down
4 changes: 2 additions & 2 deletions benchmark/scripts/perf_test_driver/perf_test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#
# ===----------------------------------------------------------------------===//

import os
import subprocess
import multiprocessing
import os
import re
import subprocess

class Result(object):
def __init__(self, name, status, output, xfail_list):
Expand Down
3 changes: 2 additions & 1 deletion benchmark/utils/convertToJSON.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
# ]
# }

import sys
import json
import re
import sys

# Parse lines like this
# #,TEST,SAMPLES,MIN(ms),MAX(ms),MEAN(ms),SD(ms),MEDIAN(ms)
SCORERE = re.compile(r"(\d+),[ \t]*(\w+),[ \t]*([\d.]+),[ \t]*([\d.]+)")
Expand Down
72 changes: 36 additions & 36 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# sys.path.insert(0, os.path.abspath('.'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
Expand All @@ -34,7 +34,7 @@
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'contents'
Expand All @@ -54,11 +54,11 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%Y-%m-%d'

Expand All @@ -67,14 +67,14 @@
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
Expand All @@ -86,7 +86,7 @@
highlight_language = 'swift'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# modindex_common_prefix = []


# -- Options for HTML output ---------------------------------------------------
Expand All @@ -112,14 +112,14 @@

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -137,40 +137,40 @@

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {'index': 'indexsidebar.html'}
# html_sidebars = {'index': 'indexsidebar.html'}

# Additional templates that should be rendered to pages, maps page names to
# template names.
html_additional_pages = {'LangRef': 'archive/LangRef.html'}

# If false, no module index is generated.
#html_domain_indices = True
# html_domain_indices = True

# If false, no index is generated.
#html_use_index = True
# html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False
# html_split_index = False

# If true, links to the reST sources are added to the pages.
html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'Swiftdoc'
Expand All @@ -180,13 +180,13 @@

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
# 'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
Expand All @@ -198,23 +198,23 @@

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True


# -- Options for manual page output --------------------------------------------
Expand All @@ -227,28 +227,28 @@
]

# If true, show URL addresses after external links.
#man_show_urls = False
# man_show_urls = False


# -- Options for Texinfo output ------------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
# dir menu entry, description, category)
texinfo_documents = [
('contents', 'Swift', u'Swift Documentation',
u'LLVM project', 'Swift', 'One line description of project.',
'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# texinfo_show_urls = 'footnote'


# FIXME: Define intersphinx configuration.
Expand All @@ -265,7 +265,7 @@
#

# Pull in the Swift lexers
from os.path import dirname, abspath, join as join_paths
from os.path import abspath, dirname, join as join_paths
sys.path = [
join_paths(dirname(dirname(abspath(__file__))), 'utils', 'pygments')
] + sys.path
Expand Down
Loading

0 comments on commit 1fae0d1

Please sign in to comment.