[clang] [clang][NFC] fix name lookup for llvm::json::Value in SymbolGraphSerializer (PR #94511)
Yuxuan Chen via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 5 11:05:49 PDT 2024
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/94511
This code uses two namespaces, `llvm` and `llvm::json`. However, we have both `llvm::Value` and `llvm::json::Value`. Whenever any of the headers declare or include `llvm::Value`, the lookup becomes ambiguous.
Fixing this by qualifying the `Value` type.
>From a30c40129f7b462e96258d4893a2ec1aebdce685 Mon Sep 17 00:00:00 2001
From: Yuxuan Chen <yuxuanchen1997 at outlook.com>
Date: Wed, 5 Jun 2024 11:03:16 -0700
Subject: [PATCH] [clang][NFC] fix name lookup for llvm::json::Value in
SymbolGraphSerializer
---
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
index 08e711cafae28..6e56ee5b573f6 100644
--- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
@@ -31,7 +31,6 @@
using namespace clang;
using namespace clang::extractapi;
using namespace llvm;
-using namespace llvm::json;
namespace {
@@ -1036,9 +1035,9 @@ void SymbolGraphSerializer::serializeGraphToStream(
ExtendedModule &&EM) {
Object Root = serializeGraph(ModuleName, std::move(EM));
if (Options.Compact)
- OS << formatv("{0}", Value(std::move(Root))) << "\n";
+ OS << formatv("{0}", json::Value(std::move(Root))) << "\n";
else
- OS << formatv("{0:2}", Value(std::move(Root))) << "\n";
+ OS << formatv("{0:2}", json::Value(std::move(Root))) << "\n";
}
void SymbolGraphSerializer::serializeMainSymbolGraph(
More information about the cfe-commits
mailing list