Skip to content

[rebranch] Assortment of rebranch fixes #67589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/swift/ABI/ObjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#ifndef SWIFT_ABI_OBJECTFILE_H
#define SWIFT_ABI_OBJECTFILE_H

#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"

namespace swift {

Expand Down
1 change: 1 addition & 0 deletions lib/IDETool/DependencyChecking.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

#include "swift/Basic/LLVM.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/VirtualFileSystem.h"
Expand Down
1 change: 1 addition & 0 deletions tools/SourceKit/include/SourceKit/Core/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "SourceKit/Core/LLVM.h"
#include "SourceKit/Support/CancellationToken.h"
#include "SourceKit/Support/Concurrency.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Mutex.h"
Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/include/SourceKit/Core/LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ namespace llvm {
template<typename T> class ArrayRef;
template<unsigned InternalLen> class SmallString;
template<typename T, unsigned N> class SmallVector;
template<typename T> class SmallVectorImpl;
template<typename T> class Optional;
template <typename T>
class SmallVectorImpl;

template<typename T>
struct SaveAndRestore;
Expand Down
3 changes: 2 additions & 1 deletion tools/SourceKit/lib/Support/Concurrency-libdispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
//
//===----------------------------------------------------------------------===//

#include "SourceKit/Support/Concurrency.h"
#include "SourceKit/Config/config.h"
#include "SourceKit/Support/Concurrency.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/thread.h"
Expand Down
10 changes: 7 additions & 3 deletions tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "TestOptions.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
Expand All @@ -36,7 +37,10 @@ enum Opt {
};

// Create prefix string literals used in Options.td.
#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
#define PREFIX(NAME, VALUE) \
constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
NAME##_init, std::size(NAME##_init) - 1);
#include "Options.inc"
#undef PREFIX

Expand All @@ -53,9 +57,9 @@ static const llvm::opt::OptTable::Info InfoTable[] = {
};

// Create OptTable class for parsing actual command line arguments
class TestOptTable : public llvm::opt::OptTable {
class TestOptTable : public llvm::opt::GenericOptTable {
public:
TestOptTable() : OptTable(InfoTable, std::size(InfoTable)){}
TestOptTable() : GenericOptTable(InfoTable) {}
};

} // end anonymous namespace
Expand Down
23 changes: 13 additions & 10 deletions tools/SourceKit/tools/sourcekitd/lib/Service/Requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
Expand Down Expand Up @@ -580,12 +581,12 @@ handleRequestGlobalConfiguration(const RequestDict &Req,
ResponseBuilder RB;
auto dict = RB.getDictionary();

Optional<unsigned> CompletionMaxASTContextReuseCount =
Req.getOptionalInt64(KeyCompletionMaxASTContextReuseCount)
.transform([](int64_t v) -> unsigned { return v; });
Optional<unsigned> CompletionCheckDependencyInterval =
Req.getOptionalInt64(KeyCompletionCheckDependencyInterval)
.transform([](int64_t v) -> unsigned { return v; });
Optional<unsigned> CompletionMaxASTContextReuseCount = swift::transform(
Req.getOptionalInt64(KeyCompletionMaxASTContextReuseCount),
[](int64_t v) -> unsigned { return v; });
Optional<unsigned> CompletionCheckDependencyInterval = swift::transform(
Req.getOptionalInt64(KeyCompletionCheckDependencyInterval),
[](int64_t v) -> unsigned { return v; });

GlobalConfig::Settings UpdatedConfig =
Config->update(CompletionMaxASTContextReuseCount,
Expand Down Expand Up @@ -1674,10 +1675,12 @@ handleRequestCollectVariableType(const RequestDict &Req,
if (getCompilerArgumentsForRequestOrEmitError(Req, Args, Rec))
return;

Optional<unsigned> Offset = Req.getOptionalInt64(KeyOffset).transform(
[](int64_t v) -> unsigned { return v; });
Optional<unsigned> Length = Req.getOptionalInt64(KeyLength).transform(
[](int64_t v) -> unsigned { return v; });
Optional<unsigned> Offset =
swift::transform(Req.getOptionalInt64(KeyOffset),
[](int64_t v) -> unsigned { return v; });
Optional<unsigned> Length =
swift::transform(Req.getOptionalInt64(KeyLength),
[](int64_t v) -> unsigned { return v; });
int64_t FullyQualified = false;
Req.getInt64(KeyFullyQualified, FullyQualified, /*isOptional=*/true);
return Lang.collectVariableTypes(
Expand Down
1 change: 1 addition & 0 deletions tools/libMockPlugin/MockPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

#include "swift-c/MockPlugin/MockPlugin.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/JSON.h"

Expand Down
2 changes: 1 addition & 1 deletion tools/libSwiftScan/libSwiftScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static void addFrontendFlagOption(llvm::opt::OptTable &table,
std::vector<std::string> &frontendOptions) {
if (table.getOption(id).hasFlag(swift::options::FrontendOption)) {
auto name = table.getOptionName(id);
if (strlen(name) > 0) {
if (!name.empty()) {
frontendOptions.push_back(std::string(name));
}
}
Expand Down