Skip to content

Commit 2f86d67

Browse files
authored
Merge pull request #27396 from shahmishal/master-rebranch
Update master to support apple/stable/20190619 branch for LLVM projects
2 parents 5726179 + dd59ce5 commit 2f86d67

File tree

159 files changed

+816
-7281
lines changed

Some content is hidden

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

159 files changed

+816
-7281
lines changed

include/swift/AST/ASTNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ namespace swift {
3636
enum class DeclKind : uint8_t;
3737
enum class StmtKind;
3838

39-
struct ASTNode : public llvm::PointerUnion3<Expr*, Stmt*, Decl*> {
39+
struct ASTNode : public llvm::PointerUnion<Expr*, Stmt*, Decl*> {
4040
// Inherit the constructors from PointerUnion.
41-
using PointerUnion3::PointerUnion3;
42-
41+
using PointerUnion::PointerUnion;
42+
4343
SourceRange getSourceRange() const;
4444

4545
/// Return the location of the start of the statement.

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4810,7 +4810,7 @@ class VarDecl : public AbstractStorageDecl {
48104810
};
48114811

48124812
protected:
4813-
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4813+
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
48144814

48154815
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
48164816
bool issCaptureList, SourceLoc nameLoc, Identifier name,

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ WARNING(implicit_bridging_header_imported_from_module,none,
9191
"is deprecated and will be removed in a later version of Swift",
9292
(StringRef, Identifier))
9393

94-
WARNING(clang_vfs_overlay_is_ignored,none,
95-
"ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of "
96-
"'-vfsoverlay'", ())
97-
9894
#ifndef DIAG_NO_UNDEF
9995
# if defined(DIAG)
10096
# undef DIAG

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class GenericSignatureBuilder {
9292
class ResolvedType;
9393

9494
using UnresolvedRequirementRHS =
95-
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
95+
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
9696

9797
using RequirementRHS =
98-
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
98+
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
9999

100100
/// The location of a requirement as written somewhere in the source.
101101
typedef llvm::PointerUnion<const TypeRepr *, const RequirementRepr *>
@@ -1373,8 +1373,8 @@ class GenericSignatureBuilder::FloatingRequirementSource {
13731373
} kind;
13741374

13751375
using Storage =
1376-
llvm::PointerUnion3<const RequirementSource *, const TypeRepr *,
1377-
const RequirementRepr *>;
1376+
llvm::PointerUnion<const RequirementSource *, const TypeRepr *,
1377+
const RequirementRepr *>;
13781378

13791379
Storage storage;
13801380

include/swift/AST/ModuleLoader.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#include "llvm/ADT/SmallSet.h"
2525
#include "llvm/ADT/TinyPtrVector.h"
2626

27+
namespace llvm {
28+
class FileCollector;
29+
}
30+
2731
namespace clang {
2832
class DependencyCollector;
2933
}
@@ -54,8 +58,9 @@ enum class Bridgeability : unsigned {
5458
class DependencyTracker {
5559
std::shared_ptr<clang::DependencyCollector> clangCollector;
5660
public:
57-
58-
explicit DependencyTracker(bool TrackSystemDeps);
61+
explicit DependencyTracker(
62+
bool TrackSystemDeps,
63+
std::shared_ptr<llvm::FileCollector> FileCollector = {});
5964

6065
/// Adds a file as a dependency.
6166
///

include/swift/AST/TypeCheckRequests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ struct WhereClauseOwner {
367367

368368
/// The source of the where clause, which can be a generic parameter list
369369
/// or a declaration that can have a where clause.
370-
llvm::PointerUnion3<GenericParamList *, Decl *, SpecializeAttr *> source;
370+
llvm::PointerUnion<GenericParamList *, Decl *, SpecializeAttr *> source;
371371

372372
WhereClauseOwner(Decl *decl);
373373

include/swift/Basic/LLVM.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ namespace llvm {
4242
template<typename T> class MutableArrayRef;
4343
template<typename T> class TinyPtrVector;
4444
template<typename T> class Optional;
45-
template <typename PT1, typename PT2> class PointerUnion;
46-
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
45+
template <typename ...PTs> class PointerUnion;
4746
class SmallBitVector;
4847

4948
// Other common classes.
@@ -68,7 +67,6 @@ namespace swift {
6867
using llvm::None;
6968
using llvm::Optional;
7069
using llvm::PointerUnion;
71-
using llvm::PointerUnion3;
7270
using llvm::SmallBitVector;
7371
using llvm::SmallPtrSet;
7472
using llvm::SmallPtrSetImpl;

include/swift/ClangImporter/ClangImporter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace llvm {
2525
class Triple;
26+
class FileCollector;
2627
template<typename Fn> class function_ref;
2728
}
2829

@@ -149,7 +150,8 @@ class ClangImporter final : public ClangModuleLoader {
149150
/// Create a new clang::DependencyCollector customized to
150151
/// ClangImporter's specific uses.
151152
static std::shared_ptr<clang::DependencyCollector>
152-
createDependencyCollector(bool TrackSystemDeps);
153+
createDependencyCollector(bool TrackSystemDeps,
154+
std::shared_ptr<llvm::FileCollector> FileCollector);
153155

154156
/// Append visible module names to \p names. Note that names are possibly
155157
/// duplicated, and not guaranteed to be ordered in any way.

include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ class ClangImporterOptions {
9696
/// When set, don't enforce warnings with -Werror.
9797
bool DebuggerSupport = false;
9898

99-
/// When set, clobber the Clang instance's virtual file system with the Swift
100-
/// virtual file system.
101-
bool ForceUseSwiftVirtualFileSystem = false;
102-
10399
/// Return a hash code of any components from these options that should
104100
/// contribute to a Swift Bridging PCH hash.
105101
llvm::hash_code getPCHHashComponents() const {

include/swift/LLVMPasses/Passes.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
34-
const llvm::MemoryLocation &Loc);
33+
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
34+
const llvm::MemoryLocation &Loc) {
35+
llvm::AAQueryInfo AAQI;
36+
return getModRefInfo(Call, Loc, AAQI);
37+
}
38+
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
39+
const llvm::MemoryLocation &Loc,
40+
llvm::AAQueryInfo &AAQI);
3541
};
3642

3743
class SwiftAAWrapperPass : public llvm::ImmutablePass {

include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "llvm/ADT/SetVector.h"
4141

4242
namespace llvm {
43-
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
43+
template <typename... PTs> class PointerUnion;
4444
}
4545

4646
namespace swift {

include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class LoopRegion {
384384
private:
385385
/// A pointer to one of a Loop, Basic Block, or Function represented by this
386386
/// region.
387-
llvm::PointerUnion3<FunctionTy *, LoopTy *, BlockTy *> Ptr;
387+
llvm::PointerUnion<FunctionTy *, LoopTy *, BlockTy *> Ptr;
388388

389389
/// The ID of this region.
390390
unsigned ID;

lib/AST/Builtins.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ Type IntrinsicTypeDecoder::decodeImmediate() {
13781378
case IITDescriptor::HalfVecArgument:
13791379
case IITDescriptor::VarArg:
13801380
case IITDescriptor::Token:
1381+
case IITDescriptor::VecElementArgument:
13811382
case IITDescriptor::VecOfAnyPtrsToElt:
13821383
// These types cannot be expressed in swift yet.
13831384
return Type();

lib/AST/Decl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5079,6 +5079,10 @@ bool VarDecl::isSettable(const DeclContext *UseDC,
50795079
if (!isLet())
50805080
return supportsMutation();
50815081

5082+
// Debugger expression 'let's are initialized through a side-channel.
5083+
if (isDebuggerVar())
5084+
return false;
5085+
50825086
// We have a 'let'; we must be checking settability from a specific
50835087
// DeclContext to go on further.
50845088
if (UseDC == nullptr)

lib/AST/ModuleLoader.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
#include "clang/Frontend/Utils.h"
1919
#include "swift/ClangImporter/ClangImporter.h"
2020

21+
namespace llvm {
22+
class FileCollector;
23+
}
24+
2125
namespace swift {
2226

23-
DependencyTracker::DependencyTracker(bool TrackSystemDeps)
24-
// NB: The ClangImporter believes it's responsible for the construction of
25-
// this instance, and it static_cast<>s the instance pointer to its own
26-
// subclass based on that belief. If you change this to be some other
27-
// instance, you will need to change ClangImporter's code to handle the
28-
// difference.
29-
: clangCollector(ClangImporter::createDependencyCollector(TrackSystemDeps))
30-
{
31-
}
27+
DependencyTracker::DependencyTracker(
28+
bool TrackSystemDeps, std::shared_ptr<llvm::FileCollector> FileCollector)
29+
// NB: The ClangImporter believes it's responsible for the construction of
30+
// this instance, and it static_cast<>s the instance pointer to its own
31+
// subclass based on that belief. If you change this to be some other
32+
// instance, you will need to change ClangImporter's code to handle the
33+
// difference.
34+
: clangCollector(ClangImporter::createDependencyCollector(TrackSystemDeps,
35+
FileCollector)) {}
3236

3337
void
3438
DependencyTracker::addDependency(StringRef File, bool IsSystem) {

lib/Basic/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ macro(find_first_existing_vc_file out_var path)
3030
)
3131
endmacro()
3232

33-
set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake")
33+
set(generate_vcs_version_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GenerateVersionFromVCS.cmake")
3434

3535
function(generate_revision_inc revision_inc_var name dir)
3636
find_first_existing_vc_file(dep_file "${dir}")
@@ -39,12 +39,12 @@ function(generate_revision_inc revision_inc_var name dir)
3939
string(TOUPPER ${name} upper_name)
4040
if(DEFINED dep_file)
4141
add_custom_command(OUTPUT "${revision_inc}"
42-
DEPENDS "${dep_file}" "${get_svn_script}"
42+
DEPENDS "${dep_file}" "${generate_vcs_version_script}"
4343
COMMAND
44-
${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${dir}"
45-
"-DFIRST_NAME=${upper_name}"
44+
${CMAKE_COMMAND} "-DNAMES=${upper_name}"
45+
"-D${upper_name}_SOURCE_DIR=${dir}"
4646
"-DHEADER_FILE=${revision_inc}"
47-
-P "${get_svn_script}")
47+
-P "${generate_vcs_version_script}")
4848
else()
4949
# Generate an empty Revision.inc file if we are not using git or SVN.
5050
file(WRITE "${revision_inc}" "")

lib/Basic/Platform.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
141141
case llvm::Triple::Ananas:
142142
case llvm::Triple::CloudABI:
143143
case llvm::Triple::DragonFly:
144+
case llvm::Triple::Emscripten:
144145
case llvm::Triple::Fuchsia:
145146
case llvm::Triple::KFreeBSD:
146147
case llvm::Triple::Lv2:
@@ -161,6 +162,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
161162
case llvm::Triple::AMDPAL:
162163
case llvm::Triple::HermitCore:
163164
case llvm::Triple::Hurd:
165+
case llvm::Triple::WASI:
164166
return "";
165167
case llvm::Triple::Darwin:
166168
case llvm::Triple::MacOSX:

lib/ClangImporter/ClangAdapter.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,21 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx,
436436
// OpenMP types that don't have Swift equivalents.
437437
case clang::BuiltinType::OMPArraySection:
438438
return OmissionTypeName();
439+
440+
// SVE builtin types that don't have Swift equivalents.
441+
case clang::BuiltinType::SveInt8:
442+
case clang::BuiltinType::SveInt16:
443+
case clang::BuiltinType::SveInt32:
444+
case clang::BuiltinType::SveInt64:
445+
case clang::BuiltinType::SveUint8:
446+
case clang::BuiltinType::SveUint16:
447+
case clang::BuiltinType::SveUint32:
448+
case clang::BuiltinType::SveUint64:
449+
case clang::BuiltinType::SveFloat16:
450+
case clang::BuiltinType::SveFloat32:
451+
case clang::BuiltinType::SveFloat64:
452+
case clang::BuiltinType::SveBool:
453+
return OmissionTypeName();
439454
}
440455
}
441456

0 commit comments

Comments
 (0)