diff options
author | Daniel Grumberg <dgrumberg@apple.com> | 2022-03-16 13:38:54 +0000 |
---|---|---|
committer | Daniel Grumberg <dgrumberg@apple.com> | 2022-03-23 16:34:08 +0000 |
commit | 5ef2ec7e4e129cb9a1d9e688fbf8590a85f01530 (patch) | |
tree | 9caca4ea73b2ec2d9c39edc9953511bf49d684b1 /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | |
parent | 2da5c5781e5a833f52a47752d76423bbb7bcf1a1 (diff) | |
download | llvm-5ef2ec7e4e129cb9a1d9e688fbf8590a85f01530.zip llvm-5ef2ec7e4e129cb9a1d9e688fbf8590a85f01530.tar.gz llvm-5ef2ec7e4e129cb9a1d9e688fbf8590a85f01530.tar.bz2 |
[clang][extract-api] Suppprt for the module name property in SymbolGraph
Adds `--product-name=` flag to the clang driver. This gets forwarded to
cc1 only when we are performing a ExtractAPI Action. This is used to
populate the `name` field of the module object in the generated SymbolGraph.
Differential Revision: https://reviews.llvm.org/D122141
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
-rw-r--r-- | clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp index b12d911..f262aab 100644 --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -376,10 +376,9 @@ Object SymbolGraphSerializer::serializeMetadata() const { Object SymbolGraphSerializer::serializeModule() const { Object Module; - // FIXME: We might not be building a module, some Clang-based languages might - // not have a "module" concept. Figure out a way to provide a name to - // describe the API set. - Module["name"] = ""; + // The user is expected to always pass `--product-name=` on the command line + // to populate this field. + Module["name"] = ProductName; serializeObject(Module, "platform", serializePlatform(API.getTarget())); return Module; } |