[gn build] Port rest of 9cfeba5b (LowLevelType->Support)
This adds all the CodeGen deps all over the place.
I ran
git show 9cfeba5b > foo2.txt
to get the original patch into a text file and then ran
#!/usr/bin/env python3
import os
in_cmake = False
for l in open('foo2.txt'):
if l.startswith('+++ b/'):
cmake = l[len('+++ b/'):-1]
in_cmake = 'CMakeLists.txt' in cmake
if not in_cmake:
continue
prefix = 'llvm/utils/gn/secondary/'
gn_file = os.path.join(prefix, os.path.dirname(cmake), 'BUILD.gn')
if l.startswith('+ '):
add = l[1:].strip()
if add == 'CodeGen':
try:
with open(gn_file) as f:
contents = f.read()
except:
print(f'skipping {gn_file}')
continue
contents = contents.replace(' deps = [', ' deps = ["//llvm/lib/CodeGen",')
with open(gn_file, 'w') as f:
f.write(contents)
to update all the GN files.
(I manually removed the dep on CodeGen that this added to llvm-min-tblgen.)
Finally, I ran
git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
to fix up the formatting.
parent
b9e1e6af
Please register or sign in to comment