Bugs were found by Svace static analysis tool. Null pointers are
dereferenced right after error checking that does not return from
function.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D147706
This adds all the CodeGen deps all over the place.
I ran
git show 9cfeba5b12b6 > 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.
This reduces dependencies on `llvm-tblgen` so much.
`CodeGenTypes` depends on `Support` at the moment.
Be careful to append deps on this, since Targets' tablegens
depend on this.
Depends on D149024
Differential Revision: https://reviews.llvm.org/D148769
This is rework of;
- rG13e77db2df94 (r328395; MVT)
Since `LowLevelType.h` has been restored to `CodeGen`, `MachinveValueType.h`
can be restored as well.
Depends on D148767
Differential Revision: https://reviews.llvm.org/D149024
This is rework of;
- D30046 (LLT)
Since I have introduced `llvm-min-tblgen` as D146352, `llvm-tblgen`
may depend on `CodeGen`.
`LowLevlType.h` originally belonged to `CodeGen`. Almost all userse are
still under `CodeGen` or `Target`. I think `CodeGen` is the right place
to put `LowLevelType.h`.
`MachineValueType.h` may be moved as well. (later, D149024)
I have made many modules depend on `CodeGen`. It is consistent but
inefficient. It will be split out later, D148769
Besides, I had to isolate MVT and LLT in modmap, since
`llvm::PredicateInfo` clashes between `TableGen/CodeGenSchedule.h`
and `Transforms/Utils/PredicateInfo.h`.
(I think better to introduce namespace llvm::TableGen)
Depends on D145937, D146352, and D148768.
Differential Revision: https://reviews.llvm.org/D148767
`llvm-min-tblgen` is capable of building `llvm/include/llvm`;
- `-gen-attrs`
- `-gen-directive-*`
- `-gen-intrinsics-*`
- `-gen-riscv-target-def`
`llvm-min-tblgen` is built and used only when `llvm-tblgen` is built in-tree.
This is not installed.
`llvm-tblgen` is built with complete set and may be installed.
`check-llvm` uses not `llvm-min-tblgen` but `llvm-tblgen`.
`LLVM_TABLEGEN_PROJECT` overrides the definition of `tablegen(project)`.
`LLVM_HEADERS` is used as the overridden prefix for LLVM header generators.
If `EXPORT` is not specified in `add_tablegen`, its tablegen is treated as internal.
Let `llvm-tblgen` depend on `intrinsics_gen`
Depends on D149072
Differential Revision: https://reviews.llvm.org/D146352