Skip to content

Commit f603dfe

Browse files
committed
---
yaml --- r: 274399 b: refs/heads/master-next c: 22e2d1d h: refs/heads/master i: 274397: fea8abd 274395: 0719e10 274391: 3d84ed0 274383: 125ea2f 274367: 82f0db9
1 parent 2fe4058 commit f603dfe

File tree

13 files changed

+45
-28
lines changed

13 files changed

+45
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: cbef630f19f869ab5279731179bd731f12b3b9d5
3-
refs/heads/master-next: e8219a5d04f660131f3e03866be5407c8537d1ee
3+
refs/heads/master-next: 22e2d1dee048cd145129cfeeb7b4ea33dd7dc952
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/include/swift/LLVMPasses/Passes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
33+
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
3434
const llvm::MemoryLocation &Loc);
3535
};
3636

branches/master-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/master-next/lib/Basic/Platform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
142142
case llvm::Triple::AMDPAL:
143143
case llvm::Triple::HermitCore:
144144
case llvm::Triple::Hurd:
145+
case llvm::Triple::WASI:
145146
return "";
146147
case llvm::Triple::Darwin:
147148
case llvm::Triple::MacOSX:

branches/master-next/lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8055,6 +8055,7 @@ ClangImporter::Implementation::createConstant(Identifier name, DeclContext *dc,
80558055
case clang::APValue::Array:
80568056
case clang::APValue::ComplexFloat:
80578057
case clang::APValue::ComplexInt:
8058+
case clang::APValue::FixedPoint:
80588059
case clang::APValue::LValue:
80598060
case clang::APValue::MemberPointer:
80608061
case clang::APValue::Struct:

branches/master-next/lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ llvm::CallSite CallEmission::emitCallSite() {
15991599
{ opaqueCallee });
16001600
opaqueCallee =
16011601
IGF.Builder.CreateBitCast(opaqueCallee, origCallee->getType());
1602-
call->setCalledFunction(opaqueCallee);
1602+
call->setCalledFunction(fn.getFunctionType(), opaqueCallee);
16031603

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

branches/master-next/lib/IRGen/GenDecl.cpp

Lines changed: 4 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"
@@ -4082,7 +4081,10 @@ IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
40824081
llvm::FunctionType *fnTy =
40834082
llvm::FunctionType::get(resultTy, paramTys, false);
40844083

4085-
llvm::Constant *fn = Module.getOrInsertFunction(fnName, fnTy);
4084+
llvm::Constant *fn =
4085+
cast<llvm::Function>(Module.getOrInsertFunction(fnName, fnTy)
4086+
.getCallee()
4087+
->stripPointerCasts());
40864088

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

branches/master-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/master-next/lib/IRGen/GenKeyPath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ emitKeyPathComponent(IRGenModule &IGM,
989989
fnName.append("keypath_get_selector_");
990990
fnName.append(selectorName);
991991
auto fn = cast<llvm::Function>(
992-
IGM.Module.getOrInsertFunction(fnName, fnTy));
992+
IGM.Module.getOrInsertFunction(fnName, fnTy).getCallee());
993993
if (fn->empty()) {
994994
fn->setLinkage(llvm::Function::PrivateLinkage);
995995
IRGenFunction subIGF(IGM, fn);

branches/master-next/lib/IRGen/IRGen.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
#include "llvm/Transforms/IPO/AlwaysInliner.h"
7171
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
7272
#include "llvm/Transforms/Instrumentation.h"
73+
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
74+
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
7375
#include "llvm/Transforms/ObjCARC.h"
7476

7577
#include <thread>
@@ -125,12 +127,12 @@ static void addSwiftMergeFunctionsPass(const PassManagerBuilder &Builder,
125127
static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
126128
legacy::PassManagerBase &PM) {
127129
PM.add(createAddressSanitizerFunctionPass());
128-
PM.add(createAddressSanitizerModulePass());
130+
PM.add(createModuleAddressSanitizerLegacyPassPass());
129131
}
130132

131133
static void addThreadSanitizerPass(const PassManagerBuilder &Builder,
132134
legacy::PassManagerBase &PM) {
133-
PM.add(createThreadSanitizerPass());
135+
PM.add(createThreadSanitizerLegacyPassPass());
134136
}
135137

136138
static void addSanitizerCoveragePass(const PassManagerBuilder &Builder,

branches/master-next/lib/IRGen/IRGenModule.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ llvm::Constant *swift::getRuntimeFn(llvm::Module &Module,
571571
{argTypes.begin(), argTypes.end()},
572572
/*isVararg*/ false);
573573

574-
cache = Module.getOrInsertFunction(name, fnTy);
574+
cache =
575+
cast<llvm::Function>(Module.getOrInsertFunction(name, fnTy).getCallee());
575576

576577
// Add any function attributes and set the calling convention.
577578
if (auto fn = dyn_cast<llvm::Function>(cache)) {
@@ -961,8 +962,9 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
961962
if (linkLib.shouldForceLoad()) {
962963
llvm::SmallString<64> buf;
963964
encodeForceLoadSymbolName(buf, linkLib.getName());
964-
auto ForceImportThunk =
965-
Module.getOrInsertFunction(buf, llvm::FunctionType::get(VoidTy, false));
965+
auto ForceImportThunk = cast<llvm::Function>(
966+
Module.getOrInsertFunction(buf, llvm::FunctionType::get(VoidTy, false))
967+
.getCallee());
966968
ApplyIRLinkage(IRLinkage::ExternalImport)
967969
.to(cast<llvm::GlobalValue>(ForceImportThunk));
968970

branches/master-next/lib/LLVMPasses/ARCEntryPointBuilder.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ class ARCEntryPointBuilder {
260260
auto AttrList = AttributeList::get(M.getContext(), 1, Attribute::NoCapture);
261261
AttrList = AttrList.addAttribute(
262262
M.getContext(), AttributeList::FunctionIndex, Attribute::NoUnwind);
263-
CheckUnowned = M.getOrInsertFunction("swift_checkUnowned", AttrList,
264-
Type::getVoidTy(M.getContext()),
265-
ObjectPtrTy);
263+
CheckUnowned = cast<llvm::Function>(
264+
M.getOrInsertFunction("swift_checkUnowned", AttrList,
265+
Type::getVoidTy(M.getContext()), ObjectPtrTy)
266+
.getCallee());
266267
if (llvm::Triple(M.getTargetTriple()).isOSBinFormatCOFF() &&
267268
!llvm::Triple(M.getTargetTriple()).isOSCygMing())
268269
if (auto *F = llvm::dyn_cast<llvm::Function>(CheckUnowned.get()))

branches/master-next/lib/LLVMPasses/LLVMSwiftAA.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ static ModRefInfo getConservativeModRefForKind(const llvm::Instruction &I) {
3232
llvm_unreachable("Not a valid Instruction.");
3333
}
3434

35-
ModRefInfo SwiftAAResult::getModRefInfo(llvm::ImmutableCallSite CS,
35+
ModRefInfo SwiftAAResult::getModRefInfo(const llvm::CallBase *Call,
3636
const llvm::MemoryLocation &Loc) {
3737
// We know at compile time that certain entry points do not modify any
3838
// compiler-visible state ever. Quickly check if we have one of those
3939
// instructions and return if so.
40-
if (ModRefInfo::NoModRef ==
41-
getConservativeModRefForKind(*CS.getInstruction()))
40+
if (ModRefInfo::NoModRef == getConservativeModRefForKind(*Call))
4241
return ModRefInfo::NoModRef;
4342

4443
// Otherwise, delegate to the rest of the AA ModRefInfo machinery.
45-
return AAResultBase::getModRefInfo(CS, Loc);
44+
return AAResultBase::getModRefInfo(Call, Loc);
4645
}
4746

4847
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)