Skip to content

Commit a907ca3

Browse files
committed
---
yaml --- r: 299007 b: refs/heads/test-tensorflow-next c: 5b8a7d1 h: refs/heads/master i: 299005: ca56ebc 299003: 9cf3c24 298999: 530367a 298991: 4d37045 298975: 0289d3c 298943: aae8787 298879: 93f7e9c 298751: c43ef7b 298495: 3642eb0 297983: 9aea85e 296959: 0682b93 294911: 1f1cc10
1 parent 7585ca0 commit a907ca3

Some content is hidden

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

53 files changed

+311
-251
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,4 +1327,4 @@ refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-04-25-a: da4947bb59331e85417a82de5
13271327
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-04-10-a: d748c5bc98a12ebd70743995a747003951ab2146
13281328
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-04-16-a: 1bfb725ec5b403151f108ac04469c2bde6296cde
13291329
refs/heads/better-unbroadcasting: b8d0cb14a542ba366c30dcc1311b171d18d71fd4
1330-
refs/heads/test-tensorflow-next: 80aad109a32b02e403d1a550487228f13d4b55db
1330+
refs/heads/test-tensorflow-next: 5b8a7d1b99d7acdee1b723abac233400a753f7f2

branches/test-tensorflow-next/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.

branches/test-tensorflow-next/include/swift/AST/Decl.h

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

47754775
protected:
4776-
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4776+
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47774777

47784778
VarDecl(DeclKind Kind, bool IsStatic, Specifier Sp, bool IsCaptureList,
47794779
SourceLoc NameLoc, Identifier Name, DeclContext *DC)

branches/test-tensorflow-next/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 *>
@@ -1374,8 +1374,8 @@ class GenericSignatureBuilder::FloatingRequirementSource {
13741374
} kind;
13751375

13761376
using Storage =
1377-
llvm::PointerUnion3<const RequirementSource *, const TypeRepr *,
1378-
const RequirementRepr *>;
1377+
llvm::PointerUnion<const RequirementSource *, const TypeRepr *,
1378+
const RequirementRepr *>;
13791379

13801380
Storage storage;
13811381

branches/test-tensorflow-next/include/swift/AST/TypeCheckRequests.h

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

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

306306
WhereClauseOwner(Decl *decl);
307307

branches/test-tensorflow-next/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;

branches/test-tensorflow-next/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 {

branches/test-tensorflow-next/include/swift/Parse/Parser.h

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

4040
namespace llvm {
41-
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
41+
template <typename... PTs> class PointerUnion;
4242
}
4343

4444
namespace swift {

branches/test-tensorflow-next/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;

branches/test-tensorflow-next/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}" "")

branches/test-tensorflow-next/lib/Basic/Platform.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
122122
case llvm::Triple::Ananas:
123123
case llvm::Triple::CloudABI:
124124
case llvm::Triple::DragonFly:
125+
case llvm::Triple::Emscripten:
125126
case llvm::Triple::Fuchsia:
126127
case llvm::Triple::KFreeBSD:
127128
case llvm::Triple::Lv2:
@@ -142,6 +143,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
142143
case llvm::Triple::AMDPAL:
143144
case llvm::Triple::HermitCore:
144145
case llvm::Triple::Hurd:
146+
case llvm::Triple::WASI:
145147
return "";
146148
case llvm::Triple::Darwin:
147149
case llvm::Triple::MacOSX:

branches/test-tensorflow-next/lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ namespace {
221221
error);
222222
assert(!error && "failed to allocated read-only zero-filled memory");
223223
init(static_cast<char *>(memory.base()),
224-
static_cast<char *>(memory.base()) + memory.size() - 1,
224+
static_cast<char *>(memory.base()) + memory.allocatedSize() - 1,
225225
/*null-terminated*/true);
226226
}
227227

@@ -1012,16 +1012,17 @@ ClangImporter::create(ASTContext &ctx,
10121012

10131013
// Set up the file manager.
10141014
{
1015+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS;
10151016
if (!ctx.SearchPathOpts.VFSOverlayFiles.empty()) {
10161017
// If the clang instance has overlays it means the user has provided
10171018
// -ivfsoverlay options and swift -vfsoverlay options. We're going to
10181019
// clobber their file system with our own, so warn about it.
10191020
if (!instance.getHeaderSearchOpts().VFSOverlayFiles.empty()) {
10201021
ctx.Diags.diagnose(SourceLoc(), diag::clang_vfs_overlay_is_ignored);
10211022
}
1022-
instance.setVirtualFileSystem(ctx.SourceMgr.getFileSystem());
1023+
VFS = ctx.SourceMgr.getFileSystem();
10231024
}
1024-
instance.createFileManager();
1025+
instance.createFileManager(std::move(VFS));
10251026
}
10261027

10271028
// Don't stop emitting messages if we ever can't load a module.
@@ -1035,8 +1036,7 @@ ClangImporter::create(ASTContext &ctx,
10351036
clangDiags.setSeverity(clang::diag::err_module_not_built,
10361037
clang::diag::Severity::Error,
10371038
clang::SourceLocation());
1038-
clangDiags.setSuppressAfterFatalError(
1039-
!ctx.Diags.getShowDiagnosticsAfterFatalError());
1039+
clangDiags.setFatalsAsError(ctx.Diags.getShowDiagnosticsAfterFatalError());
10401040

10411041

10421042
// Create the associated action.

branches/test-tensorflow-next/lib/ClangImporter/ImportDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8108,10 +8108,12 @@ ClangImporter::Implementation::createConstant(Identifier name, DeclContext *dc,
81088108
case clang::APValue::Array:
81098109
case clang::APValue::ComplexFloat:
81108110
case clang::APValue::ComplexInt:
8111+
case clang::APValue::FixedPoint:
8112+
case clang::APValue::Indeterminate:
81118113
case clang::APValue::LValue:
81128114
case clang::APValue::MemberPointer:
8115+
case clang::APValue::None:
81138116
case clang::APValue::Struct:
8114-
case clang::APValue::Uninitialized:
81158117
case clang::APValue::Union:
81168118
case clang::APValue::Vector:
81178119
llvm_unreachable("Unhandled APValue kind");

branches/test-tensorflow-next/lib/ClangImporter/SwiftLookupTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ class SwiftLookupTable {
307307
static bool contextRequiresName(ContextKind kind);
308308

309309
/// A single entry referencing either a named declaration or a macro.
310-
typedef llvm::PointerUnion3<clang::NamedDecl *, clang::MacroInfo *,
311-
clang::ModuleMacro *>
310+
typedef llvm::PointerUnion<clang::NamedDecl *, clang::MacroInfo *,
311+
clang::ModuleMacro *>
312312
SingleEntry;
313313

314314
/// A stored version of the context of an entity, which is Clang

branches/test-tensorflow-next/lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ llvm::CallSite CallEmission::emitCallSite() {
16091609
{ opaqueCallee });
16101610
opaqueCallee =
16111611
IGF.Builder.CreateBitCast(opaqueCallee, origCallee->getType());
1612-
call->setCalledFunction(opaqueCallee);
1612+
call->setCalledFunction(fn.getFunctionType(), opaqueCallee);
16131613

16141614
// Reset the insert point to after the call.
16151615
IGF.Builder.SetInsertPoint(call->getParent());

branches/test-tensorflow-next/lib/IRGen/GenClass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,7 @@ namespace {
19981998
case llvm::Triple::MachO:
19991999
var->setSection("__DATA, __objc_const");
20002000
break;
2001+
case llvm::Triple::XCOFF:
20012002
case llvm::Triple::COFF:
20022003
var->setSection(".data");
20032004
break;

branches/test-tensorflow-next/lib/IRGen/GenDecl.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "llvm/IR/GlobalAlias.h"
4242
#include "llvm/IR/InlineAsm.h"
4343
#include "llvm/IR/Module.h"
44-
#include "llvm/IR/TypeBuilder.h"
4544
#include "llvm/IR/Value.h"
4645
#include "llvm/Support/Compiler.h"
4746
#include "llvm/Support/ConvertUTF.h"
@@ -881,6 +880,7 @@ std::string IRGenModule::GetObjCSectionName(StringRef Section,
881880
: ("__DATA," + Section + "," + MachOAttributes).str();
882881
case llvm::Triple::ELF:
883882
return Section.substr(2).str();
883+
case llvm::Triple::XCOFF:
884884
case llvm::Triple::COFF:
885885
return ("." + Section.substr(2) + "$B").str();
886886
case llvm::Triple::Wasm:
@@ -912,6 +912,7 @@ void IRGenModule::SetCStringLiteralSection(llvm::GlobalVariable *GV,
912912
}
913913
case llvm::Triple::ELF:
914914
return;
915+
case llvm::Triple::XCOFF:
915916
case llvm::Triple::COFF:
916917
return;
917918
case llvm::Triple::Wasm:
@@ -1313,6 +1314,7 @@ static std::string getDynamicReplacementSection(IRGenModule &IGM) {
13131314
case llvm::Triple::Wasm:
13141315
sectionName = "swift5_replace";
13151316
break;
1317+
case llvm::Triple::XCOFF:
13161318
case llvm::Triple::COFF:
13171319
sectionName = ".sw5repl$B";
13181320
break;
@@ -1333,6 +1335,7 @@ static std::string getDynamicReplacementSomeSection(IRGenModule &IGM) {
13331335
case llvm::Triple::Wasm:
13341336
sectionName = "swift5_replac2";
13351337
break;
1338+
case llvm::Triple::XCOFF:
13361339
case llvm::Triple::COFF:
13371340
sectionName = ".sw5reps$B";
13381341
break;
@@ -3002,6 +3005,7 @@ llvm::Constant *IRGenModule::emitSwiftProtocols() {
30023005
case llvm::Triple::Wasm:
30033006
sectionName = "swift5_protocols";
30043007
break;
3008+
case llvm::Triple::XCOFF:
30053009
case llvm::Triple::COFF:
30063010
sectionName = ".sw5prt$B";
30073011
break;
@@ -3062,6 +3066,7 @@ llvm::Constant *IRGenModule::emitProtocolConformances() {
30623066
case llvm::Triple::Wasm:
30633067
sectionName = "swift5_protocol_conformances";
30643068
break;
3069+
case llvm::Triple::XCOFF:
30653070
case llvm::Triple::COFF:
30663071
sectionName = ".sw5prtc$B";
30673072
break;
@@ -3087,6 +3092,7 @@ llvm::Constant *IRGenModule::emitTypeMetadataRecords() {
30873092
case llvm::Triple::Wasm:
30883093
sectionName = "swift5_type_metadata";
30893094
break;
3095+
case llvm::Triple::XCOFF:
30903096
case llvm::Triple::COFF:
30913097
sectionName = ".sw5tymd$B";
30923098
break;
@@ -3155,6 +3161,7 @@ llvm::Constant *IRGenModule::emitFieldDescriptors() {
31553161
case llvm::Triple::Wasm:
31563162
sectionName = "swift5_fieldmd";
31573163
break;
3164+
case llvm::Triple::XCOFF:
31583165
case llvm::Triple::COFF:
31593166
sectionName = ".sw5flmd$B";
31603167
break;
@@ -4423,7 +4430,10 @@ IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
44234430
llvm::FunctionType *fnTy =
44244431
llvm::FunctionType::get(resultTy, paramTys, false);
44254432

4426-
llvm::Constant *fn = Module.getOrInsertFunction(fnName, fnTy);
4433+
llvm::Constant *fn =
4434+
cast<llvm::Function>(Module.getOrInsertFunction(fnName, fnTy)
4435+
.getCallee()
4436+
->stripPointerCasts());
44274437

44284438
if (llvm::Function *def = shouldDefineHelper(*this, fn, setIsNoInline)) {
44294439
IRGenFunction IGF(*this, def);

branches/test-tensorflow-next/lib/IRGen/GenExistential.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,11 @@ class OpaqueExistentialTypeInfo final :
842842
// Use copy-on-write existentials?
843843
auto fn = getAssignBoxedOpaqueExistentialBufferFunction(
844844
IGF.IGM, getLayout(), objPtrTy);
845-
auto call =
846-
IGF.Builder.CreateCall(fn, {dest.getAddress(), src.getAddress()});
845+
auto destAddress = IGF.Builder.CreateBitCast(
846+
dest.getAddress(), cast<llvm::Function>(fn)->arg_begin()[0].getType());
847+
auto srcAddress = IGF.Builder.CreateBitCast(
848+
src.getAddress(), cast<llvm::Function>(fn)->arg_begin()[1].getType());
849+
auto call = IGF.Builder.CreateCall(fn, {destAddress, srcAddress});
847850
call->setCallingConv(IGF.IGM.DefaultCC);
848851
call->setDoesNotThrow();
849852
return;
@@ -903,7 +906,10 @@ class OpaqueExistentialTypeInfo final :
903906
// Use copy-on-write existentials?
904907
auto fn = getDestroyBoxedOpaqueExistentialBufferFunction(
905908
IGF.IGM, getLayout(), addr.getAddress()->getType());
906-
auto call = IGF.Builder.CreateCall(fn, {addr.getAddress()});
909+
auto call = IGF.Builder.CreateCall(
910+
fn, {IGF.Builder.CreateBitCast(
911+
addr.getAddress(),
912+
cast<llvm::Function>(fn)->arg_begin()->getType())});
907913
call->setCallingConv(IGF.IGM.DefaultCC);
908914
call->setDoesNotThrow();
909915
return;
@@ -2045,8 +2051,11 @@ Address irgen::emitAllocateBoxedOpaqueExistentialBuffer(
20452051
/// Call a function to handle the non-fixed case.
20462052
auto *allocateFun = getAllocateBoxedOpaqueExistentialBufferFunction(
20472053
IGF.IGM, existLayout, existentialContainer.getAddress()->getType());
2048-
auto *call =
2049-
IGF.Builder.CreateCall(allocateFun, {existentialContainer.getAddress()});
2054+
auto *call = IGF.Builder.CreateCall(
2055+
allocateFun,
2056+
{IGF.Builder.CreateBitCast(
2057+
existentialContainer.getAddress(),
2058+
cast<llvm::Function>(allocateFun)->arg_begin()->getType())});
20502059
call->setCallingConv(IGF.IGM.DefaultCC);
20512060
call->setDoesNotThrow();
20522061
auto addressOfValue = IGF.Builder.CreateBitCast(call, valuePointerType);

branches/test-tensorflow-next/lib/IRGen/GenKeyPath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ emitKeyPathComponent(IRGenModule &IGM,
907907
fnName.append("keypath_get_selector_");
908908
fnName.append(selectorName);
909909
auto fn = cast<llvm::Function>(
910-
IGM.Module.getOrInsertFunction(fnName, fnTy));
910+
IGM.Module.getOrInsertFunction(fnName, fnTy).getCallee());
911911
if (fn->empty()) {
912912
fn->setLinkage(llvm::Function::PrivateLinkage);
913913
IRGenFunction subIGF(IGM, fn);

branches/test-tensorflow-next/lib/IRGen/GenMeta.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void IRGenModule::setTrueConstGlobal(llvm::GlobalVariable *var) {
115115
case llvm::Triple::ELF:
116116
var->setSection(".rodata");
117117
break;
118+
case llvm::Triple::XCOFF:
118119
case llvm::Triple::COFF:
119120
var->setSection(".rdata");
120121
break;

branches/test-tensorflow-next/lib/IRGen/GenReflection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ static std::string getReflectionSectionName(IRGenModule &IGM,
930930
switch (IGM.TargetInfo.OutputObjectFormat) {
931931
case llvm::Triple::UnknownObjectFormat:
932932
llvm_unreachable("unknown object format");
933+
case llvm::Triple::XCOFF:
933934
case llvm::Triple::COFF:
934935
assert(FourCC.size() <= 4 &&
935936
"COFF section name length must be <= 8 characters");

0 commit comments

Comments
 (0)