aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-03-21 23:40:38 +0000
committerSean Silva <silvas@purdue.edu>2013-03-21 23:40:38 +0000
commitcdd21b333a9b495f41fda81b5240360dcba06f7a (patch)
tree9e67d095d080ef63ab17ba080ba8fc45f1e3b6d9 /llvm/utils/TableGen/TableGen.cpp
parent173c71ff3d06fcca28442e423759357117e1916b (diff)
downloadllvm-cdd21b333a9b495f41fda81b5240360dcba06f7a.zip
llvm-cdd21b333a9b495f41fda81b5240360dcba06f7a.tar.gz
llvm-cdd21b333a9b495f41fda81b5240360dcba06f7a.tar.bz2
Add TableGen ctags(1) emitter and helper script.
To use this in conjunction with exuberant ctags to generate a single combined tags file, run tblgen first and then $ ctags --append [...] Since some identifiers have corresponding definitions in C++ code, it can be useful (if using vim) to also use cscope, and :set cscopetagorder=1 so that :tag X will preferentially select the tablegen symbol, while :cscope find g X will always find the C++ symbol. Patch by Kevin Schoedel! (a couple small formatting changes courtesy of clang-format) llvm-svn: 177682
Diffstat (limited to 'llvm/utils/TableGen/TableGen.cpp')
-rw-r--r--llvm/utils/TableGen/TableGen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp
index 510f254..b5c3ca76 100644
--- a/llvm/utils/TableGen/TableGen.cpp
+++ b/llvm/utils/TableGen/TableGen.cpp
@@ -40,7 +40,8 @@ enum ActionType {
GenTgtIntrinsic,
PrintEnums,
PrintSets,
- GenOptParserDefs
+ GenOptParserDefs,
+ GenCTags
};
namespace {
@@ -82,6 +83,8 @@ namespace {
"Print expanded sets for testing DAG exprs"),
clEnumValN(GenOptParserDefs, "gen-opt-parser-defs",
"Generate option definitions"),
+ clEnumValN(GenCTags, "gen-ctags",
+ "Generate ctags-compatible index"),
clEnumValEnd));
cl::opt<std::string>
@@ -161,6 +164,9 @@ bool LLVMTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
}
break;
}
+ case GenCTags:
+ EmitCTags(Records, OS);
+ break;
}
return false;