diff options
author | heretic <heretic@yandex-team.ru> | 2022-02-10 16:45:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:46 +0300 |
commit | 81eddc8c0b55990194e112b02d127b87d54164a9 (patch) | |
tree | 9142afc54d335ea52910662635b898e79e192e49 /contrib/libs/llvm12/utils | |
parent | 397cbe258b9e064f49c4ca575279f02f39fef76e (diff) | |
download | ydb-81eddc8c0b55990194e112b02d127b87d54164a9.tar.gz |
Restoring authorship annotation for <heretic@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/utils')
-rwxr-xr-x | contrib/libs/llvm12/utils/DSAclean.py | 68 | ||||
-rwxr-xr-x | contrib/libs/llvm12/utils/DSAextract.py | 224 | ||||
-rw-r--r-- | contrib/libs/llvm12/utils/TableGen/.yandex_meta/licenses.list.txt | 14 | ||||
-rw-r--r-- | contrib/libs/llvm12/utils/TableGen/GlobalISel/.yandex_meta/licenses.list.txt | 14 | ||||
-rw-r--r-- | contrib/libs/llvm12/utils/TableGen/GlobalISel/ya.make | 24 | ||||
-rw-r--r-- | contrib/libs/llvm12/utils/TableGen/ya.make | 20 |
6 files changed, 182 insertions, 182 deletions
diff --git a/contrib/libs/llvm12/utils/DSAclean.py b/contrib/libs/llvm12/utils/DSAclean.py index edc00c7f601..c5fb56b037e 100755 --- a/contrib/libs/llvm12/utils/DSAclean.py +++ b/contrib/libs/llvm12/utils/DSAclean.py @@ -1,35 +1,35 @@ #!/usr/bin/env python - -#changelog: -#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove -#nodes such as %tmp.1.i and %tmp._i.3 -#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just -#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spelling error in -#the comments -#10/12/2005: now it only removes nodes and edges for which the label is %tmp.# rather -#than removing all lines for which the lable CONTAINS %tmp.# - -from __future__ import print_function - -import re -import sys -if( len(sys.argv) < 3 ): - print('usage is: ./DSAclean <dot_file_to_be_cleaned> <out_put_file>') - sys.exit(1) -#get a file object -input = open(sys.argv[1], 'r') -output = open(sys.argv[2], 'w') -#we'll get this one line at a time...while we could just put the whole thing in a string -#it would kill old computers -buffer = input.readline() -while buffer != '': - if re.compile("label(\s*)=(\s*)\"\s%tmp(.\w*)*(\s*)\"").search(buffer): - #skip next line, write neither this line nor the next - buffer = input.readline() - else: - #this isn't a tmp Node, we can write it - output.write(buffer) - #prepare for the next iteration - buffer = input.readline() -input.close() -output.close() + +#changelog: +#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove +#nodes such as %tmp.1.i and %tmp._i.3 +#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just +#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spelling error in +#the comments +#10/12/2005: now it only removes nodes and edges for which the label is %tmp.# rather +#than removing all lines for which the lable CONTAINS %tmp.# + +from __future__ import print_function + +import re +import sys +if( len(sys.argv) < 3 ): + print('usage is: ./DSAclean <dot_file_to_be_cleaned> <out_put_file>') + sys.exit(1) +#get a file object +input = open(sys.argv[1], 'r') +output = open(sys.argv[2], 'w') +#we'll get this one line at a time...while we could just put the whole thing in a string +#it would kill old computers +buffer = input.readline() +while buffer != '': + if re.compile("label(\s*)=(\s*)\"\s%tmp(.\w*)*(\s*)\"").search(buffer): + #skip next line, write neither this line nor the next + buffer = input.readline() + else: + #this isn't a tmp Node, we can write it + output.write(buffer) + #prepare for the next iteration + buffer = input.readline() +input.close() +output.close() diff --git a/contrib/libs/llvm12/utils/DSAextract.py b/contrib/libs/llvm12/utils/DSAextract.py index dc2b93df494..1d93f1e30c5 100755 --- a/contrib/libs/llvm12/utils/DSAextract.py +++ b/contrib/libs/llvm12/utils/DSAextract.py @@ -1,113 +1,113 @@ #!/usr/bin/env python - -#this is a script to extract given named nodes from a dot file, with -#the associated edges. An edge is kept iff for edge x -> y -# x and y are both nodes specified to be kept. - -#known issues: if a line contains '->' and is not an edge line -#problems will occur. If node labels do not begin with -#Node this also will not work. Since this is designed to work -#on DSA dot output and not general dot files this is ok. -#If you want to use this on other files rename the node labels -#to Node[.*] with a script or something. This also relies on -#the length of a node name being 13 characters (as it is in all -#DSA dot output files) - -#Note that the name of the node can be any substring of the actual -#name in the dot file. Thus if you say specify COLLAPSED -#as a parameter this script will pull out all COLLAPSED -#nodes in the file - -#Specifying escape characters in the name like \n also will not work, -#as Python -#will make it \\n, I'm not really sure how to fix this - -#currently the script prints the names it is searching for -#to STDOUT, so you can check to see if they are what you intend - -from __future__ import print_function - -import re -import string -import sys - - -if len(sys.argv) < 3: - print('usage is ./DSAextract <dot_file_to_modify> \ - <output_file> [list of nodes to extract]') - -#open the input file -input = open(sys.argv[1], 'r') - -#construct a set of node names -node_name_set = set() -for name in sys.argv[3:]: - node_name_set |= set([name]) - -#construct a list of compiled regular expressions from the -#node_name_set -regexp_list = [] -for name in node_name_set: - regexp_list.append(re.compile(name)) - -#used to see what kind of line we are on -nodeexp = re.compile('Node') -#used to check to see if the current line is an edge line -arrowexp = re.compile('->') - -node_set = set() - -#read the file one line at a time -buffer = input.readline() -while buffer != '': - #filter out the unnecessary checks on all the edge lines - if not arrowexp.search(buffer): - #check to see if this is a node we are looking for - for regexp in regexp_list: - #if this name is for the current node, add the dot variable name - #for the node (it will be Node(hex number)) to our set of nodes - if regexp.search(buffer): - node_set |= set([re.split('\s+',buffer,2)[1]]) - break - buffer = input.readline() - - -#test code -#print '\n' - -print(node_name_set) - -#print node_set - - -#open the output file -output = open(sys.argv[2], 'w') -#start the second pass over the file -input = open(sys.argv[1], 'r') - -buffer = input.readline() -while buffer != '': - #there are three types of lines we are looking for - #1) node lines, 2) edge lines 3) support lines (like page size, etc) - - #is this an edge line? - #note that this is no completely robust, if a none edge line - #for some reason contains -> it will be missidentified - #hand edit the file if this happens - if arrowexp.search(buffer): - #check to make sure that both nodes are in the node list - #if they are print this to output - nodes = arrowexp.split(buffer) - nodes[0] = string.strip(nodes[0]) - nodes[1] = string.strip(nodes[1]) - if nodes[0][:13] in node_set and \ - nodes[1][:13] in node_set: - output.write(buffer) - elif nodeexp.search(buffer): #this is a node line - node = re.split('\s+', buffer,2)[1] - if node in node_set: - output.write(buffer) - else: #this is a support line - output.write(buffer) - buffer = input.readline() - + +#this is a script to extract given named nodes from a dot file, with +#the associated edges. An edge is kept iff for edge x -> y +# x and y are both nodes specified to be kept. + +#known issues: if a line contains '->' and is not an edge line +#problems will occur. If node labels do not begin with +#Node this also will not work. Since this is designed to work +#on DSA dot output and not general dot files this is ok. +#If you want to use this on other files rename the node labels +#to Node[.*] with a script or something. This also relies on +#the length of a node name being 13 characters (as it is in all +#DSA dot output files) + +#Note that the name of the node can be any substring of the actual +#name in the dot file. Thus if you say specify COLLAPSED +#as a parameter this script will pull out all COLLAPSED +#nodes in the file + +#Specifying escape characters in the name like \n also will not work, +#as Python +#will make it \\n, I'm not really sure how to fix this + +#currently the script prints the names it is searching for +#to STDOUT, so you can check to see if they are what you intend + +from __future__ import print_function + +import re +import string +import sys + + +if len(sys.argv) < 3: + print('usage is ./DSAextract <dot_file_to_modify> \ + <output_file> [list of nodes to extract]') + +#open the input file +input = open(sys.argv[1], 'r') + +#construct a set of node names +node_name_set = set() +for name in sys.argv[3:]: + node_name_set |= set([name]) + +#construct a list of compiled regular expressions from the +#node_name_set +regexp_list = [] +for name in node_name_set: + regexp_list.append(re.compile(name)) + +#used to see what kind of line we are on +nodeexp = re.compile('Node') +#used to check to see if the current line is an edge line +arrowexp = re.compile('->') + +node_set = set() + +#read the file one line at a time +buffer = input.readline() +while buffer != '': + #filter out the unnecessary checks on all the edge lines + if not arrowexp.search(buffer): + #check to see if this is a node we are looking for + for regexp in regexp_list: + #if this name is for the current node, add the dot variable name + #for the node (it will be Node(hex number)) to our set of nodes + if regexp.search(buffer): + node_set |= set([re.split('\s+',buffer,2)[1]]) + break + buffer = input.readline() + + +#test code +#print '\n' + +print(node_name_set) + +#print node_set + + +#open the output file +output = open(sys.argv[2], 'w') +#start the second pass over the file +input = open(sys.argv[1], 'r') + +buffer = input.readline() +while buffer != '': + #there are three types of lines we are looking for + #1) node lines, 2) edge lines 3) support lines (like page size, etc) + + #is this an edge line? + #note that this is no completely robust, if a none edge line + #for some reason contains -> it will be missidentified + #hand edit the file if this happens + if arrowexp.search(buffer): + #check to make sure that both nodes are in the node list + #if they are print this to output + nodes = arrowexp.split(buffer) + nodes[0] = string.strip(nodes[0]) + nodes[1] = string.strip(nodes[1]) + if nodes[0][:13] in node_set and \ + nodes[1][:13] in node_set: + output.write(buffer) + elif nodeexp.search(buffer): #this is a node line + node = re.split('\s+', buffer,2)[1] + if node in node_set: + output.write(buffer) + else: #this is a support line + output.write(buffer) + buffer = input.readline() + diff --git a/contrib/libs/llvm12/utils/TableGen/.yandex_meta/licenses.list.txt b/contrib/libs/llvm12/utils/TableGen/.yandex_meta/licenses.list.txt index a4433625d4a..c62d353021c 100644 --- a/contrib/libs/llvm12/utils/TableGen/.yandex_meta/licenses.list.txt +++ b/contrib/libs/llvm12/utils/TableGen/.yandex_meta/licenses.list.txt @@ -1,7 +1,7 @@ -====================Apache-2.0 WITH LLVM-exception==================== -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. - - -====================Apache-2.0 WITH LLVM-exception==================== -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +====================Apache-2.0 WITH LLVM-exception==================== +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. + + +====================Apache-2.0 WITH LLVM-exception==================== +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/contrib/libs/llvm12/utils/TableGen/GlobalISel/.yandex_meta/licenses.list.txt b/contrib/libs/llvm12/utils/TableGen/GlobalISel/.yandex_meta/licenses.list.txt index a4433625d4a..c62d353021c 100644 --- a/contrib/libs/llvm12/utils/TableGen/GlobalISel/.yandex_meta/licenses.list.txt +++ b/contrib/libs/llvm12/utils/TableGen/GlobalISel/.yandex_meta/licenses.list.txt @@ -1,7 +1,7 @@ -====================Apache-2.0 WITH LLVM-exception==================== -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. - - -====================Apache-2.0 WITH LLVM-exception==================== -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +====================Apache-2.0 WITH LLVM-exception==================== +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. + + +====================Apache-2.0 WITH LLVM-exception==================== +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/contrib/libs/llvm12/utils/TableGen/GlobalISel/ya.make b/contrib/libs/llvm12/utils/TableGen/GlobalISel/ya.make index fce9474bd31..4a072b7300d 100644 --- a/contrib/libs/llvm12/utils/TableGen/GlobalISel/ya.make +++ b/contrib/libs/llvm12/utils/TableGen/GlobalISel/ya.make @@ -2,22 +2,22 @@ LIBRARY() -OWNER( - orivej - g:cpp-contrib -) - -LICENSE(Apache-2.0 WITH LLVM-exception) - -LICENSE_TEXTS(.yandex_meta/licenses.list.txt) - +OWNER( + orivej + g:cpp-contrib +) + +LICENSE(Apache-2.0 WITH LLVM-exception) + +LICENSE_TEXTS(.yandex_meta/licenses.list.txt) + PEERDIR( contrib/libs/llvm12 ) -ADDINCL( - contrib/libs/llvm12/utils/TableGen/GlobalISel -) +ADDINCL( + contrib/libs/llvm12/utils/TableGen/GlobalISel +) NO_COMPILER_WARNINGS() diff --git a/contrib/libs/llvm12/utils/TableGen/ya.make b/contrib/libs/llvm12/utils/TableGen/ya.make index 6ba6c827870..69c2241a4d1 100644 --- a/contrib/libs/llvm12/utils/TableGen/ya.make +++ b/contrib/libs/llvm12/utils/TableGen/ya.make @@ -2,15 +2,15 @@ PROGRAM(llvm-tblgen) -OWNER( - orivej - g:cpp-contrib -) +OWNER( + orivej + g:cpp-contrib +) + +LICENSE(Apache-2.0 WITH LLVM-exception) -LICENSE(Apache-2.0 WITH LLVM-exception) +LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -LICENSE_TEXTS(.yandex_meta/licenses.list.txt) - PEERDIR( contrib/libs/llvm12 contrib/libs/llvm12/lib/Demangle @@ -19,9 +19,9 @@ PEERDIR( contrib/libs/llvm12/utils/TableGen/GlobalISel ) -ADDINCL( - contrib/libs/llvm12/utils/TableGen -) +ADDINCL( + contrib/libs/llvm12/utils/TableGen +) NO_COMPILER_WARNINGS() |