[clang-tools-extra] r341467 - [clangd] Fix type/variable name conflict on some compilers
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 5 06:22:11 PDT 2018
Author: sammccall
Date: Wed Sep 5 06:22:11 2018
New Revision: 341467
URL: http://llvm.org/viewvc/llvm-project?rev=341467&view=rev
Log:
[clangd] Fix type/variable name conflict on some compilers
Modified:
clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
Modified: clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp?rev=341467&r1=341466&r2=341467&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp (original)
+++ clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp Wed Sep 5 06:22:11 2018
@@ -60,13 +60,12 @@ static llvm::cl::opt<bool> MergeOnTheFly
"MapReduce."),
llvm::cl::init(true), llvm::cl::Hidden);
-enum Format { YAML, Binary };
-static llvm::cl::opt<Format>
- Format("format", llvm::cl::desc("Format of the index to be written"),
- llvm::cl::values(
- clEnumValN(Format::YAML, "yaml", "human-readable YAML format"),
- clEnumValN(Format::Binary, "binary", "binary RIFF format")),
- llvm::cl::init(Format::YAML));
+enum IndexFormat { YAML, Binary };
+static llvm::cl::opt<IndexFormat> Format(
+ "format", llvm::cl::desc("Format of the index to be written"),
+ llvm::cl::values(clEnumValN(YAML, "yaml", "human-readable YAML format"),
+ clEnumValN(Binary, "binary", "binary RIFF format")),
+ llvm::cl::init(YAML));
/// Responsible for aggregating symbols from each processed file and producing
/// the final results. All methods in this class must be thread-safe,
@@ -273,10 +272,10 @@ int main(int argc, const char **argv) {
auto UniqueSymbols = Consumer->mergeResults();
// Output phase: emit result symbols.
switch (clang::clangd::Format) {
- case clang::clangd::Format::YAML:
+ case clang::clangd::IndexFormat::YAML:
SymbolsToYAML(UniqueSymbols, llvm::outs());
break;
- case clang::clangd::Format::Binary: {
+ case clang::clangd::IndexFormat::Binary: {
clang::clangd::IndexFileOut Out;
Out.Symbols = &UniqueSymbols;
llvm::outs() << Out;
More information about the cfe-commits
mailing list