Skip to content

Commit 446a523

Browse files
hossainjmphisiart
authored andcommitted
included astgen/... and fixed the import issues.
1 parent 7f28cbf commit 446a523

187 files changed

Lines changed: 26888 additions & 712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

maldoca/astgen/BUILD

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
16+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
17+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
18+
19+
20+
21+
licenses(["notice"])
22+
23+
package(
24+
default_applicable_licenses = ["//:license"],
25+
default_visibility = [
26+
"//:__subpackages__",
27+
],
28+
)
29+
30+
proto_library(
31+
name = "ast_def_proto",
32+
srcs = ["ast_def.proto"],
33+
deps = [":type_proto"],
34+
)
35+
36+
cc_proto_library(
37+
name = "ast_def_cc_proto",
38+
deps = ["ast_def_proto"],
39+
)
40+
41+
cc_library(
42+
name = "ast_def",
43+
srcs = [
44+
"ast_def.cc",
45+
"type.cc",
46+
],
47+
hdrs = [
48+
"ast_def.h",
49+
"type.h",
50+
],
51+
deps = [
52+
":ast_def_cc_proto",
53+
":symbol",
54+
":type_cc_proto",
55+
"//maldoca/base:status",
56+
"@abseil-cpp//absl/algorithm:container",
57+
"@abseil-cpp//absl/base:nullability",
58+
"@abseil-cpp//absl/container:btree",
59+
"@abseil-cpp//absl/container:flat_hash_map",
60+
"@abseil-cpp//absl/container:flat_hash_set",
61+
"@abseil-cpp//absl/functional:bind_front",
62+
"@abseil-cpp//absl/log",
63+
"@abseil-cpp//absl/log:check",
64+
"@abseil-cpp//absl/memory",
65+
"@abseil-cpp//absl/status",
66+
"@abseil-cpp//absl/status:statusor",
67+
"@abseil-cpp//absl/strings",
68+
"@abseil-cpp//absl/types:span",
69+
],
70+
)
71+
72+
cc_library(
73+
name = "ast_gen",
74+
srcs = ["ast_gen.cc"],
75+
hdrs = ["ast_gen.h"],
76+
deps = [
77+
":ast_def",
78+
":ast_def_cc_proto",
79+
":symbol",
80+
"//maldoca/base:path",
81+
"@abseil-cpp//absl/algorithm:container",
82+
"@abseil-cpp//absl/base:core_headers",
83+
"@abseil-cpp//absl/cleanup",
84+
"@abseil-cpp//absl/container:btree",
85+
"@abseil-cpp//absl/container:flat_hash_set",
86+
"@abseil-cpp//absl/log",
87+
"@abseil-cpp//absl/log:check",
88+
"@abseil-cpp//absl/strings",
89+
"@abseil-cpp//absl/strings:str_format",
90+
"@com_google_protobuf//src/google/protobuf/io",
91+
"@com_google_protobuf//src/google/protobuf/io:printer",
92+
],
93+
)
94+
95+
cc_binary(
96+
name = "ast_gen_main",
97+
srcs = ["ast_gen_main.cc"],
98+
deps = [
99+
":ast_def",
100+
":ast_def_cc_proto",
101+
":ast_gen",
102+
"//maldoca/base:filesystem",
103+
"//maldoca/base:path",
104+
"//maldoca/base:status",
105+
"@abseil-cpp//absl/flags:flag",
106+
"@abseil-cpp//absl/strings",
107+
],
108+
)
109+
110+
cc_test(
111+
name = "ast_gen_test",
112+
srcs = ["ast_gen_test.cc"],
113+
deps = [
114+
":ast_def",
115+
":ast_def_cc_proto",
116+
":ast_gen",
117+
":symbol",
118+
"//maldoca/base:filesystem",
119+
"//maldoca/base/testing:status_matchers",
120+
"@abseil-cpp//absl/memory",
121+
"@abseil-cpp//absl/strings",
122+
"@com_google_protobuf//src/google/protobuf/io",
123+
"@googletest//:gtest_main",
124+
],
125+
)
126+
127+
proto_library(
128+
name = "type_proto",
129+
srcs = ["type.proto"],
130+
)
131+
132+
cc_proto_library(
133+
name = "type_cc_proto",
134+
deps = ["type_proto"],
135+
)
136+
137+
cc_test(
138+
name = "type_test",
139+
srcs = ["type_test.cc"],
140+
deps = [
141+
":ast_def",
142+
":ast_def_cc_proto",
143+
":type_cc_proto",
144+
"//maldoca/base:filesystem",
145+
"//maldoca/base/testing:status_matchers",
146+
"@abseil-cpp//absl/container:flat_hash_map",
147+
"@googletest//:gtest_main",
148+
],
149+
)
150+
151+
cc_library(
152+
name = "symbol",
153+
srcs = ["symbol.cc"],
154+
hdrs = ["symbol.h"],
155+
deps = [
156+
"@abseil-cpp//absl/algorithm:container",
157+
"@abseil-cpp//absl/container:flat_hash_set",
158+
"@abseil-cpp//absl/strings",
159+
],
160+
)
161+
162+
cc_test(
163+
name = "symbol_test",
164+
srcs = ["symbol_test.cc"],
165+
deps = [
166+
":symbol",
167+
"@googletest//:gtest_main",
168+
],
169+
)

maldoca/astgen/OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# LLVM owners for API updates. (see go/mlir-sla).
2+
suggest-reviewers-ignore: file://depot/google3/llvm/OWNERS

0 commit comments

Comments
 (0)