Skip to content

Commit db8bf0b

Browse files
authored
Merge pull request #29744 from apple/master-rebranch
Merge master-rebranch into master to support new llvm branch apple/stable/20200108
2 parents 7952f05 + 227485b commit db8bf0b

File tree

326 files changed

+1746
-1317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+1746
-1317
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ endif()
3232

3333
ENABLE_LANGUAGE(C)
3434

35+
# Use C++14.
36+
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
37+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
38+
set(CMAKE_CXX_EXTENSIONS NO)
39+
3540
# First include general CMake utilities.
3641
include(SwiftUtils)
3742
include(CheckSymbolExists)

cmake/modules/SwiftXcodeSupport.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ macro(swift_common_xcode_cxx_config)
100100
# Force usage of Clang.
101101
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0"
102102
CACHE STRING "Xcode Compiler")
103-
# Use C++'11.
104-
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11"
103+
# Use C++'14.
104+
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14"
105105
CACHE STRING "Xcode C++ Language Standard")
106106
# Use libc++.
107107
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"

include/swift/ABI/TrailingObjects.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#ifndef SWIFT_ABI_TRAILINGOBJECTS_H
5656
#define SWIFT_ABI_TRAILINGOBJECTS_H
5757

58+
#include "llvm/Support/Alignment.h"
5859
#include "llvm/Support/AlignOf.h"
5960
#include "llvm/Support/Compiler.h"
6061
#include "llvm/Support/MathExtras.h"
@@ -175,7 +176,7 @@ class TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy, NextTy,
175176

176177
if (requiresRealignment())
177178
return reinterpret_cast<const NextTy *>(
178-
llvm::alignAddr(Ptr, alignof(NextTy)));
179+
llvm::alignAddr(Ptr, llvm::Align(alignof(NextTy))));
179180
else
180181
return reinterpret_cast<const NextTy *>(Ptr);
181182
}
@@ -189,7 +190,8 @@ class TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy, NextTy,
189190
Obj, TrailingObjectsBase::OverloadToken<PrevTy>());
190191

191192
if (requiresRealignment())
192-
return reinterpret_cast<NextTy *>(llvm::alignAddr(Ptr, alignof(NextTy)));
193+
return reinterpret_cast<NextTy *>(
194+
llvm::alignAddr(Ptr, llvm::Align(alignof(NextTy))));
193195
else
194196
return reinterpret_cast<NextTy *>(Ptr);
195197
}

include/swift/ABI/TypeIdentity.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define SWIFT_ABI_TYPEIDENTITY_H
2020

2121
#include "swift/Basic/LLVM.h"
22+
#include <llvm/ADT/StringRef.h>
2223

2324
namespace swift {
2425
template <class> class TargetTypeContextDescriptor;

include/swift/AST/Evaluator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class Evaluator {
345345
// Check for a cycle.
346346
if (checkDependency(activeReq)) {
347347
return llvm::Error(
348-
llvm::make_unique<CyclicalRequestError<Request>>(request, *this));
348+
std::make_unique<CyclicalRequestError<Request>>(request, *this));
349349
}
350350

351351
// Make sure we remove this from the set of active requests once we're

include/swift/AST/SimpleRequest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class SimpleRequest<Derived, Output(Inputs...), Caching> {
195195

196196
template<size_t ...Indices>
197197
llvm::Expected<Output>
198-
callDerived(Evaluator &evaluator, llvm::index_sequence<Indices...>) const {
198+
callDerived(Evaluator &evaluator, std::index_sequence<Indices...>) const {
199199
static_assert(sizeof...(Indices) > 0, "Subclass must define evaluate()");
200200
return asDerived().evaluate(evaluator, std::get<Indices>(storage)...);
201201
}
@@ -217,7 +217,7 @@ class SimpleRequest<Derived, Output(Inputs...), Caching> {
217217
static llvm::Expected<OutputType>
218218
evaluateRequest(const Derived &request, Evaluator &evaluator) {
219219
return request.callDerived(evaluator,
220-
llvm::index_sequence_for<Inputs...>());
220+
std::index_sequence_for<Inputs...>());
221221
}
222222

223223
/// Retrieve the nearest source location to which this request applies.

include/swift/Basic/Statistic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626
#define SWIFT_FUNC_STAT_NAMED(DEBUG_TYPE) \
2727
do { \
28-
static llvm::Statistic FStat = \
29-
{DEBUG_TYPE, __func__, __func__, {0}, {false}}; \
28+
static llvm::Statistic FStat = {DEBUG_TYPE, __func__, __func__}; \
3029
++FStat; \
3130
} while (0)
3231

include/swift/Frontend/Frontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ class CompilerInstance {
482482

483483
void createDependencyTracker(bool TrackSystemDeps) {
484484
assert(!Context && "must be called before setup()");
485-
DepTracker = llvm::make_unique<DependencyTracker>(TrackSystemDeps);
485+
DepTracker = std::make_unique<DependencyTracker>(TrackSystemDeps);
486486
}
487487
DependencyTracker *getDependencyTracker() { return DepTracker.get(); }
488488
const DependencyTracker *getDependencyTracker() const { return DepTracker.get(); }

include/swift/LLVMPasses/Passes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "swift/LLVMPasses/PassesFwd.h"
1717
#include "llvm/Analysis/AliasAnalysis.h"
18+
#include "llvm/Analysis/Passes.h"
19+
#include "llvm/InitializePasses.h"
1820
#include "llvm/Pass.h"
1921

2022
namespace swift {

include/swift/Reflection/TypeRef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class alignas(void *) TypeRef {
150150
void dump() const;
151151
void dump(FILE *file, unsigned Indent = 0) const;
152152

153+
/// Build a demangle tree from this TypeRef.
154+
Demangle::NodePointer getDemangling(Demangle::Demangler &Dem) const;
155+
153156
bool isConcrete() const;
154157
bool isConcreteAfterSubstitutions(const GenericArgumentMap &Subs) const;
155158

0 commit comments

Comments
 (0)