thakis created this revision.
thakis added a reviewer: phosek.

Nothing really interesting. One thing to consider is where the clang_tablegen() 
invocations that generate files that are private to a library should be. The 
CMake build puts them in clang/include/clang/Parse (in this case), but maybe 
putting them right in clang/lib/Parse/BUILD.gn makes mor sense. (For 
clang_tablegen() calls that generate .inc files used by the public headers, 
putting the call in the public BUILD file makes sense.)

For now, I've put the build file in the public header folder, since that 
matches CMake and what I did in the last 2 clang patches, but I'm not sure I 
like this.


https://reviews.llvm.org/D55925

Files:
  llvm/utils/gn/secondary/BUILD.gn
  llvm/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
  llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn


Index: llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn
===================================================================
--- /dev/null
+++ llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn
@@ -0,0 +1,32 @@
+static_library("Parse") {
+  output_name = "clangParse"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/include/clang/Parse:AttrParserStringSwitches",
+    "//clang/include/clang/Parse:AttrSubMatchRulesParserStringSwitches",
+    "//clang/lib/AST",
+    "//clang/lib/Basic",
+    "//clang/lib/Lex",
+    "//clang/lib/Sema",
+    "//llvm/lib/MC",
+    "//llvm/lib/MC/MCParser",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "ParseAST.cpp",
+    "ParseCXXInlineMethods.cpp",
+    "ParseDecl.cpp",
+    "ParseDeclCXX.cpp",
+    "ParseExpr.cpp",
+    "ParseExprCXX.cpp",
+    "ParseInit.cpp",
+    "ParseObjc.cpp",
+    "ParseOpenMP.cpp",
+    "ParsePragma.cpp",
+    "ParseStmt.cpp",
+    "ParseStmtAsm.cpp",
+    "ParseTemplate.cpp",
+    "ParseTentative.cpp",
+    "Parser.cpp",
+  ]
+}
Index: llvm/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
===================================================================
--- /dev/null
+++ llvm/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
@@ -0,0 +1,19 @@
+import("//clang/utils/TableGen/clang_tablegen.gni")
+
+clang_tablegen("AttrParserStringSwitches") {
+  args = [
+    "-gen-clang-attr-parser-string-switches",
+    "-I",
+    rebase_path("../..", root_out_dir),
+  ]
+  td_file = "../Basic/Attr.td"
+}
+
+clang_tablegen("AttrSubMatchRulesParserStringSwitches") {
+  args = [
+    "-gen-clang-attr-subject-match-rules-parser-string-switches",
+    "-I",
+    rebase_path("../..", root_out_dir),
+  ]
+  td_file = "../Basic/Attr.td"
+}
Index: llvm/utils/gn/secondary/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/BUILD.gn
+++ llvm/utils/gn/secondary/BUILD.gn
@@ -1,5 +1,6 @@
 group("default") {
   deps = [
+    "//clang/lib/Parse",
     "//clang/tools/clang-format",
     "//lld/test",
     "//llvm/tools/llvm-undname",


Index: llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn
===================================================================
--- /dev/null
+++ llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn
@@ -0,0 +1,32 @@
+static_library("Parse") {
+  output_name = "clangParse"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/include/clang/Parse:AttrParserStringSwitches",
+    "//clang/include/clang/Parse:AttrSubMatchRulesParserStringSwitches",
+    "//clang/lib/AST",
+    "//clang/lib/Basic",
+    "//clang/lib/Lex",
+    "//clang/lib/Sema",
+    "//llvm/lib/MC",
+    "//llvm/lib/MC/MCParser",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "ParseAST.cpp",
+    "ParseCXXInlineMethods.cpp",
+    "ParseDecl.cpp",
+    "ParseDeclCXX.cpp",
+    "ParseExpr.cpp",
+    "ParseExprCXX.cpp",
+    "ParseInit.cpp",
+    "ParseObjc.cpp",
+    "ParseOpenMP.cpp",
+    "ParsePragma.cpp",
+    "ParseStmt.cpp",
+    "ParseStmtAsm.cpp",
+    "ParseTemplate.cpp",
+    "ParseTentative.cpp",
+    "Parser.cpp",
+  ]
+}
Index: llvm/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
===================================================================
--- /dev/null
+++ llvm/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
@@ -0,0 +1,19 @@
+import("//clang/utils/TableGen/clang_tablegen.gni")
+
+clang_tablegen("AttrParserStringSwitches") {
+  args = [
+    "-gen-clang-attr-parser-string-switches",
+    "-I",
+    rebase_path("../..", root_out_dir),
+  ]
+  td_file = "../Basic/Attr.td"
+}
+
+clang_tablegen("AttrSubMatchRulesParserStringSwitches") {
+  args = [
+    "-gen-clang-attr-subject-match-rules-parser-string-switches",
+    "-I",
+    rebase_path("../..", root_out_dir),
+  ]
+  td_file = "../Basic/Attr.td"
+}
Index: llvm/utils/gn/secondary/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/BUILD.gn
+++ llvm/utils/gn/secondary/BUILD.gn
@@ -1,5 +1,6 @@
 group("default") {
   deps = [
+    "//clang/lib/Parse",
     "//clang/tools/clang-format",
     "//lld/test",
     "//llvm/tools/llvm-undname",
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to