Skip to content

Commit bc6f6f4

Browse files
Revert changes as requested by @gribozavr in #655
Revert changes in: * tools/SourceKit/bindings/python/sourcekitd/capi.py * utils/cmpcodesize/cmpcodesize/compare.py * utils/pass-pipeline/*
1 parent 2ce3b2b commit bc6f6f4

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

tools/SourceKit/bindings/python/sourcekitd/capi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __init__(self, value):
156156
if value >= len(ErrorKind._kinds):
157157
ErrorKind._kinds += [None] * (value - len(ErrorKind._kinds) + 1)
158158
if ErrorKind._kinds[value] is not None:
159-
raise ValueError('ErrorKind already loaded')
159+
raise ValueError,'ErrorKind already loaded'
160160
self.value = value
161161
ErrorKind._kinds[value] = self
162162
ErrorKind._name_map = None
@@ -177,7 +177,7 @@ def name(self):
177177
@staticmethod
178178
def from_id(id):
179179
if id >= len(ErrorKind._kinds) or ErrorKind._kinds[id] is None:
180-
raise ValueError('Unknown type kind {}'.format(id))
180+
raise ValueError,'Unknown type kind %d' % id
181181
return ErrorKind._kinds[id]
182182

183183
def __repr__(self):
@@ -239,7 +239,7 @@ def __init__(self, value):
239239
if value >= len(VariantType._kinds):
240240
VariantType._kinds += [None] * (value - len(VariantType._kinds) + 1)
241241
if VariantType._kinds[value] is not None:
242-
raise ValueError('VariantType already loaded')
242+
raise ValueError,'VariantType already loaded'
243243
self.value = value
244244
VariantType._kinds[value] = self
245245
VariantType._name_map = None
@@ -260,7 +260,7 @@ def name(self):
260260
@staticmethod
261261
def from_id(id):
262262
if id >= len(VariantType._kinds) or VariantType._kinds[id] is None:
263-
raise ValueError('Unknown type kind {}'.format(id))
263+
raise ValueError,'Unknown type kind %d' % id
264264
return VariantType._kinds[id]
265265

266266
def __repr__(self):
@@ -540,7 +540,7 @@ class Config:
540540
def set_library_path(path):
541541
"""Set the path in which to search for sourcekitd"""
542542
if Config.loaded:
543-
raise Exception("library path must be set before before using "
543+
raise Exception("library path must be set before before using " \
544544
"any other functionalities in sourcekitd.")
545545

546546
Config.library_path = path
@@ -549,7 +549,7 @@ def set_library_path(path):
549549
def set_library_file(filename):
550550
"""Set the exact location of sourcekitd"""
551551
if Config.loaded:
552-
raise Exception("library file must be set before before using "
552+
raise Exception("library file must be set before before using " \
553553
"any other functionalities in sourcekitd.")
554554

555555
Config.library_file = filename

utils/cmpcodesize/cmpcodesize/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def addFunction(sizes, function, startAddr, endAddr, groupByPrefix):
5050
if groupByPrefix:
5151
for infix in SortedInfixes:
5252
if infix in function:
53-
if GenericFunctionPrefix not in function:
53+
if not GenericFunctionPrefix in function:
5454
sizes[Infixes[infix]] += size
5555
return
5656
for prefix in SortedPrefixes:

utils/pass-pipeline/scripts/pipeline_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import sys
55
import argparse
6+
import itertools
67
import json
78
import textwrap
89

@@ -30,7 +31,7 @@
3031
disabled_passpipelines = sum(args.disable_passpipeline, [])
3132

3233
# First filter out pipelines.
33-
normal_pipeline_generated = [x.generate() for x in normal_pipeline if x.identifier not in disabled_passpipelines]
34+
normal_pipeline_generated = [x.generate() for x in normal_pipeline if not x.identifier in disabled_passpipelines]
3435

3536
# Then filter out specific passes.
3637
for i in range(len(normal_pipeline_generated)):

utils/pass-pipeline/scripts/pipelines_build_script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Append the src dir
1010
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src'))
1111

12+
import pass_pipeline_library
1213
import passes
1314

1415
# TODO: This should not be hard coded.

utils/pass-pipeline/src/pass_pipeline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
import sys
3+
import json
4+
import itertools
5+
16
class Pass(object):
27
def __init__(self, name):
38
self.name = name

0 commit comments

Comments
 (0)