aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Grumberg <dgrumberg@apple.com>2024-04-02 15:03:46 +0100
committerGitHub <noreply@github.com>2024-04-02 15:03:46 +0100
commitb31414bf4f9898f7817a9fcf8a91f62ec26f3eaf (patch)
tree216aa40d3f259da8c811839cd5e89f5616c6813b /clang/lib/Driver/Driver.cpp
parente03f16f9fdfcb36ed05842f43f542107a0d46288 (diff)
downloadllvm-b31414bf4f9898f7817a9fcf8a91f62ec26f3eaf.zip
llvm-b31414bf4f9898f7817a9fcf8a91f62ec26f3eaf.tar.gz
llvm-b31414bf4f9898f7817a9fcf8a91f62ec26f3eaf.tar.bz2
[clang][ExtractAPI] Add ability to create multiple symbol graphs (#86676)
This extends ExtractAPI to take into account symbols defined in categories to types defined in an external module. This introduces 2 new command line flags, `--symbol-graph-dir=DIR` and `--emit-extension-symbol-graphs`, when used together this generates additional symbol graph files at `DIR/ExtendedModule@ProductName.symbols.json` for each external module that is extended in this way. Additionally this makes some cleanups to tests to make them more resilient and cleans up the `APISet` data structure.
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1a0f5f2..e6c1767 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -49,6 +49,7 @@
#include "ToolChains/WebAssembly.h"
#include "ToolChains/XCore.h"
#include "ToolChains/ZOS.h"
+#include "clang/Basic/DiagnosticDriver.h"
#include "clang/Basic/TargetID.h"
#include "clang/Basic/Version.h"
#include "clang/Config/config.h"
@@ -5889,6 +5890,12 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
&JA);
}
+ if (JA.getType() == types::TY_API_INFO &&
+ C.getArgs().hasArg(options::OPT_emit_extension_symbol_graphs) &&
+ C.getArgs().hasArg(options::OPT_o))
+ Diag(clang::diag::err_drv_unexpected_symbol_graph_output)
+ << C.getArgs().getLastArgValue(options::OPT_o);
+
// DXC defaults to standard out when generating assembly. We check this after
// any DXC flags that might specify a file.
if (AtTopLevel && JA.getType() == types::TY_PP_Asm && IsDXCMode())