Add number of elements to overlays

This patch adds a number of stack elements to the number of overlays in
the swift_symbolgraph_extract tool. We don't get the defaults from the
llvm type on Linux so it needs to be manually specified.

I never saw the number of overlays go above zero when dumping while
running the test suite, so I don't know what a "reasonable" number looks
like here. 8 seemed like a good number at the time.
This commit is contained in:
Evan Wilde
2021-08-09 14:21:45 -07:00
parent 9d170720a3
commit 3876dbd610

View File

@@ -23,6 +23,7 @@
#include "swift/Option/Options.h"
#include "swift/SymbolGraphGen/SymbolGraphGen.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
using namespace swift;
@@ -235,7 +236,7 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args,
// don't need to print these errors.
CI.removeDiagnosticConsumer(&DiagPrinter);
SmallVector<ModuleDecl *> Overlays;
SmallVector<ModuleDecl *, 8> Overlays;
M->findDeclaredCrossImportOverlaysTransitive(Overlays);
for (const auto *OM : Overlays) {
auto CIM = CI.getASTContext().getModuleByName(OM->getNameStr());