Skip to content

Commit 9d48ebf

Browse files
committed
[docs] Add TableGen-based generator for command line argument documentation,
and generate documentation for all (non-hidden) options supported by the 'clang' driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292968 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d231537 commit 9d48ebf

10 files changed

+3823
-64
lines changed

docs/ClangCommandLineReference.rst

Lines changed: 3286 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Using Clang as a Compiler
1919
UsersManual
2020
Toolchain
2121
LanguageExtensions
22+
ClangCommandLineReference
2223
AttributeReference
2324
DiagnosticsReference
2425
CrossCompilation

include/clang/Driver/CLCompatOptions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
def cl_Group : OptionGroup<"<clang-cl options>">,
14+
def cl_Group : OptionGroup<"<clang-cl options>">, Flags<[CLOption]>,
1515
HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
1616

1717
def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//==--- ClangOptionDocs.td - Option documentation -------------------------===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
def GlobalDocumentation {
11+
code Intro =[{..
12+
-------------------------------------------------------------------
13+
NOTE: This file is automatically generated by running clang-tblgen
14+
-gen-opt-docs. Do not edit this file by hand!!
15+
-------------------------------------------------------------------
16+
17+
=====================================
18+
Clang command line argument reference
19+
=====================================
20+
.. contents::
21+
:local:
22+
23+
Introduction
24+
============
25+
26+
This page lists the command line arguments currently supported by the
27+
GCC-compatible ``clang`` and ``clang++`` drivers.
28+
29+
}];
30+
31+
string Program = "clang";
32+
list<string> ExcludedFlags = ["HelpHidden", "NoDriverOption",
33+
"CLOption", "Unsupported", "Ignored"];
34+
}
35+
36+
include "Options.td"

include/clang/Driver/Options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ enum ClangFlags {
3333
CLOption = (1 << 9),
3434
CC1Option = (1 << 10),
3535
CC1AsOption = (1 << 11),
36-
NoDriverOption = (1 << 12)
36+
NoDriverOption = (1 << 12),
37+
Ignored = (1 << 13)
3738
};
3839

3940
enum ID {

include/clang/Driver/Options.td

Lines changed: 129 additions & 60 deletions
Large diffs are not rendered by default.

utils/TableGen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ add_tablegen(clang-tblgen CLANG
77
ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
88
ClangCommentHTMLTagsEmitter.cpp
99
ClangDiagnosticsEmitter.cpp
10+
ClangOptionDocEmitter.cpp
1011
ClangSACheckersEmitter.cpp
1112
NeonEmitter.cpp
1213
TableGen.cpp

0 commit comments

Comments
 (0)