Skip to content

Commit e5a1d1c

Browse files
committed
---
yaml --- r: 348651 b: refs/heads/master c: 051159f h: refs/heads/master i: 348649: 38b3118 348647: 19e86b6
1 parent b247993 commit e5a1d1c

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 97febd42a9190367941d4e28884c1b0a9fa8ed59
2+
refs/heads/master: 051159f3b4e251d3cdf77c4209918911ec379565
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/IRGen/IRGenPublic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ createIRGenModule(SILModule *SILMod, StringRef OutputFilename,
3636
/// Delete the IRGenModule and IRGenerator obtained by the above call.
3737
void deleteIRGenModule(std::pair<IRGenerator *, IRGenModule *> &Module);
3838

39+
/// Gets the ABI version number that'll be set as a flag in the module.
40+
uint32_t getSwiftABIVersion();
41+
3942
} // end namespace irgen
4043
} // end namespace swift
4144

trunk/include/swift/TBDGen/TBDGen.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ namespace swift {
2424
class FileUnit;
2525
class ModuleDecl;
2626

27-
/// The current ABI version of Swift, as tapi labels it.
28-
const uint8_t TAPI_SWIFT_ABI_VERSION = 5;
29-
3027
/// Options for controlling the exact set of symbols included in the TBD
3128
/// output.
3229
struct TBDGenOptions {

trunk/lib/IRGen/IRGenModule.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/Basic/Dwarf.h"
2323
#include "swift/Demangling/ManglingMacros.h"
2424
#include "swift/ClangImporter/ClangImporter.h"
25+
#include "swift/IRGen/IRGenPublic.h"
2526
#include "swift/IRGen/Linking.h"
2627
#include "swift/Runtime/RuntimeFnWrappersGen.h"
2728
#include "swift/Runtime/Config.h"
@@ -1353,6 +1354,10 @@ IRGenModule *IRGenerator::getGenModule(SILFunction *f) {
13531354
return getPrimaryIGM();
13541355
}
13551356

1357+
uint32_t swift::irgen::getSwiftABIVersion() {
1358+
return IRGenModule::swiftVersion;
1359+
}
1360+
13561361
llvm::Triple IRGenerator::getEffectiveClangTriple() {
13571362
auto CI = static_cast<ClangImporter *>(
13581363
&*SIL.getASTContext().getClangModuleLoader());

trunk/lib/TBDGen/TBDGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/AST/Module.h"
2323
#include "swift/AST/ParameterList.h"
2424
#include "swift/Basic/LLVM.h"
25+
#include "swift/IRGen/IRGenPublic.h"
2526
#include "swift/IRGen/Linking.h"
2627
#include "swift/SIL/FormalLinkage.h"
2728
#include "swift/SIL/SILDeclRef.h"
@@ -608,7 +609,7 @@ static void enumeratePublicSymbolsAndWrite(ModuleDecl *M, FileUnit *singleFile,
608609
file.setCurrentVersion(convertToPacked(opts.CurrentVersion));
609610
file.setCompatibilityVersion(convertToPacked(opts.CompatibilityVersion));
610611
file.setTwoLevelNamespace();
611-
file.setSwiftABIVersion(TAPI_SWIFT_ABI_VERSION);
612+
file.setSwiftABIVersion(irgen::getSwiftABIVersion());
612613
file.setInstallAPI(opts.IsInstallAPI);
613614

614615
auto getPlatformKind =

trunk/test/TBD/abi-version.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// This test ensures that we see the same Swift ABI Version flag in the LLVM IR
4+
// and in the TBD.
5+
6+
// 1. Emit IR and a TBD for this file
7+
8+
// RUN: %target-swift-frontend -emit-ir -o %t/test.ll %s -emit-tbd-path %t/test.tbd
9+
10+
// 2. Concatenate them and FileCheck them both in the same file, so we can capture
11+
// the ABI version in a variable.
12+
13+
// RUN: cat %t/test.ll %t/test.tbd | %FileCheck %s
14+
15+
// 3. Look in the IR for the Swift Version flag
16+
17+
// CHECK: !"Swift Version", i32 [[VERSION:[0-9]+]]
18+
19+
// 4. Look in the TBD for the same version listed
20+
21+
// CHECK: swift-abi-version: [[VERSION]]

0 commit comments

Comments
 (0)