[llvm] r349831 - [gn build] Add build file for clang/lib/Parse

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 13:53:06 PST 2018


Author: nico
Date: Thu Dec 20 13:53:05 2018
New Revision: 349831

URL: http://llvm.org/viewvc/llvm-project?rev=349831&view=rev
Log:
[gn build] Add build file for clang/lib/Parse

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.

Differential Revision: https://reviews.llvm.org/D55925

Added:
    llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/
    llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
    llvm/trunk/utils/gn/secondary/clang/lib/Parse/
    llvm/trunk/utils/gn/secondary/clang/lib/Parse/BUILD.gn
Modified:
    llvm/trunk/utils/gn/secondary/BUILD.gn

Modified: llvm/trunk/utils/gn/secondary/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/BUILD.gn?rev=349831&r1=349830&r2=349831&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/BUILD.gn Thu Dec 20 13:53:05 2018
@@ -1,5 +1,6 @@
 group("default") {
   deps = [
+    "//clang/lib/Parse",
     "//clang/tools/clang-format",
     "//lld/test",
     "//llvm/tools/llvm-undname",

Added: llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn?rev=349831&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/clang/include/clang/Parse/BUILD.gn Thu Dec 20 13:53:05 2018
@@ -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"
+}

Added: llvm/trunk/utils/gn/secondary/clang/lib/Parse/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang/lib/Parse/BUILD.gn?rev=349831&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang/lib/Parse/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/clang/lib/Parse/BUILD.gn Thu Dec 20 13:53:05 2018
@@ -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",
+  ]
+}




More information about the llvm-commits mailing list