Skip to content

Commit bfd6478

Browse files
committed
Replace LLVM_EXPORT with INDEXSTOREDB_EXPORT
LLVM_EXPORT no longer exists in LLVM so we define it instead now
1 parent 6d2b38c commit bfd6478

File tree

13 files changed

+53
-20
lines changed

13 files changed

+53
-20
lines changed

include/IndexStoreDB/Database/Database.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515

1616
#include "IndexStoreDB/Database/IDCode.h"
1717
#include "IndexStoreDB/Support/LLVM.h"
18+
#include "IndexStoreDB/Support/Visibility.h"
1819
#include <memory>
1920

2021
namespace IndexStoreDB {
2122
namespace db {
2223
class Database;
2324
typedef std::shared_ptr<Database> DatabaseRef;
2425

25-
class LLVM_EXPORT Database {
26+
class INDEXSTOREDB_EXPORT Database {
2627
public:
2728
static DatabaseRef create(StringRef dbPath, bool readonly, Optional<size_t> initialDBSize, std::string &error);
2829
~Database();
@@ -43,7 +44,7 @@ class LLVM_EXPORT Database {
4344
static const unsigned DATABASE_FORMAT_VERSION;
4445
};
4546

46-
LLVM_EXPORT IDCode makeIDCodeFromString(StringRef name);
47+
INDEXSTOREDB_EXPORT IDCode makeIDCodeFromString(StringRef name);
4748

4849
} // namespace db
4950
} // namespace IndexStoreDB

include/IndexStoreDB/Database/DatabaseError.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
#ifndef INDEXSTOREDB_SKDATABASE_DATABASEERROR_H
1414
#define INDEXSTOREDB_SKDATABASE_DATABASEERROR_H
1515

16-
#include "llvm/Support/Compiler.h"
16+
#include "IndexStoreDB/Support/Visibility.h"
1717
#include <string>
1818
#include <stdexcept>
1919

2020
namespace IndexStoreDB {
2121
namespace db {
2222

23-
class LLVM_EXPORT DatabaseError : public std::runtime_error {
23+
class INDEXSTOREDB_EXPORT DatabaseError : public std::runtime_error {
2424
protected:
2525
const int _code;
2626

@@ -51,7 +51,7 @@ class LLVM_EXPORT DatabaseError : public std::runtime_error {
5151
///
5252
/// @see http://symas.com/mdb/doc/group__errors.html#ga0a83370402a060c9175100d4bbfb9f25
5353
///
54-
class LLVM_EXPORT MapFullError final : public DatabaseError {
54+
class INDEXSTOREDB_EXPORT MapFullError final : public DatabaseError {
5555
virtual void _anchor();
5656
public:
5757
using DatabaseError::DatabaseError;

include/IndexStoreDB/Database/ImportTransaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace db {
2424
class Database;
2525
typedef std::shared_ptr<Database> DatabaseRef;
2626

27-
class LLVM_EXPORT ImportTransaction {
27+
class INDEXSTOREDB_EXPORT ImportTransaction {
2828
public:
2929
explicit ImportTransaction(DatabaseRef dbase);
3030
~ImportTransaction();
@@ -48,7 +48,7 @@ class LLVM_EXPORT ImportTransaction {
4848
std::unique_ptr<Implementation> Impl;
4949
};
5050

51-
class LLVM_EXPORT UnitDataImport {
51+
class INDEXSTOREDB_EXPORT UnitDataImport {
5252
ImportTransaction &Import;
5353
std::string UnitName;
5454
CanonicalFilePath MainFile;

include/IndexStoreDB/Database/ReadTransaction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace db {
2626
class Database;
2727
typedef std::shared_ptr<Database> DatabaseRef;
2828

29-
class LLVM_EXPORT ReadTransaction {
29+
class INDEXSTOREDB_EXPORT ReadTransaction {
3030
public:
3131
explicit ReadTransaction(DatabaseRef dbase);
3232
~ReadTransaction();

include/IndexStoreDB/Index/IndexStoreLibraryProvider.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define INDEXSTOREDB_INDEX_SYMBOLDATAPROVIDER_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718
#include "llvm/ADT/StringRef.h"
1819
#include <memory>
1920

@@ -29,7 +30,7 @@ namespace index {
2930
using IndexStoreLibrary = ::indexstore::IndexStoreLibrary;
3031
using IndexStoreLibraryRef = ::indexstore::IndexStoreLibraryRef;
3132

32-
class LLVM_EXPORT IndexStoreLibraryProvider {
33+
class INDEXSTOREDB_EXPORT IndexStoreLibraryProvider {
3334
public:
3435
virtual ~IndexStoreLibraryProvider() {}
3536

@@ -41,12 +42,12 @@ class LLVM_EXPORT IndexStoreLibraryProvider {
4142
};
4243

4344
/// A simple library provider that can be used if libIndexStore is linked to your binary.
44-
class LLVM_EXPORT GlobalIndexStoreLibraryProvider: public IndexStoreLibraryProvider {
45+
class INDEXSTOREDB_EXPORT GlobalIndexStoreLibraryProvider: public IndexStoreLibraryProvider {
4546
public:
4647
IndexStoreLibraryRef getLibraryForStorePath(StringRef storePath) override;
4748
};
4849

49-
LLVM_EXPORT IndexStoreLibraryRef loadIndexStoreLibrary(std::string dylibPath,
50+
INDEXSTOREDB_EXPORT IndexStoreLibraryRef loadIndexStoreLibrary(std::string dylibPath,
5051
std::string &error);
5152

5253
} // namespace index

include/IndexStoreDB/Index/IndexSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define INDEXSTOREDB_INDEX_INDEXSYSTEM_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718
#include "llvm/ADT/OptionSet.h"
1819
#include "llvm/ADT/StringRef.h"
1920
#include "llvm/Support/Chrono.h"
@@ -37,7 +38,7 @@ namespace index {
3738
struct StoreUnitInfo;
3839
class IndexStoreLibraryProvider;
3940

40-
class LLVM_EXPORT IndexSystem {
41+
class INDEXSTOREDB_EXPORT IndexSystem {
4142
public:
4243
~IndexSystem();
4344

include/IndexStoreDB/Index/IndexSystemDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class DependentUnitOutOfDateTriggerHint : public OutOfDateTriggerHint {
6565
virtual std::string description() override;
6666
};
6767

68-
class LLVM_EXPORT IndexSystemDelegate {
68+
class INDEXSTOREDB_EXPORT IndexSystemDelegate {
6969
public:
7070
virtual ~IndexSystemDelegate() {}
7171

include/IndexStoreDB/Support/Concurrency.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
#ifndef LLVM_INDEXSTOREDB_SUPPORT_CONCURRENCY_H
1414
#define LLVM_INDEXSTOREDB_SUPPORT_CONCURRENCY_H
1515

16+
#include "IndexStoreDB/Support/Visibility.h"
1617
#include "llvm/ADT/StringRef.h"
1718

1819
namespace IndexStoreDB {
1920

20-
class LLVM_EXPORT WorkQueue {
21+
class INDEXSTOREDB_EXPORT WorkQueue {
2122
public:
2223
enum class Dequeuing {
2324
Serial,

include/IndexStoreDB/Support/FilePathWatcher.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
#define INDEXSTOREDB_SUPPORT_FILEPATHWATCHER_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718
#include "llvm/ADT/ArrayRef.h"
1819
#include "llvm/ADT/StringRef.h"
1920
#include <functional>
2021

2122
namespace IndexStoreDB {
2223

23-
class LLVM_EXPORT FilePathWatcher {
24+
class INDEXSTOREDB_EXPORT FilePathWatcher {
2425
struct Implementation;
2526

2627
public:

include/IndexStoreDB/Support/Logging.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#define LLVM_INDEXSTOREDB_SUPPORT_LOGGING_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718
#include "llvm/ADT/IntrusiveRefCntPtr.h"
1819
#include "llvm/ADT/SmallString.h"
1920
#include "llvm/ADT/StringRef.h"
20-
#include "llvm/Support/Compiler.h"
2121
#include "llvm/Support/raw_ostream.h"
2222
#include "llvm/Support/Timer.h"
2323
#include <string>
@@ -29,7 +29,7 @@ class format_object_base;
2929
namespace IndexStoreDB {
3030
class Logger;
3131

32-
LLVM_EXPORT void writeEscaped(StringRef Str, raw_ostream &OS);
32+
INDEXSTOREDB_EXPORT void writeEscaped(StringRef Str, raw_ostream &OS);
3333

3434
typedef IntrusiveRefCntPtr<Logger> LogRef;
3535

@@ -40,7 +40,7 @@ typedef IntrusiveRefCntPtr<Logger> LogRef;
4040
/// *Log << "stuff";
4141
/// }
4242
/// \endcode
43-
class LLVM_EXPORT Logger : public llvm::ThreadSafeRefCountedBase<Logger> {
43+
class INDEXSTOREDB_EXPORT Logger : public llvm::ThreadSafeRefCountedBase<Logger> {
4444
public:
4545
enum class Level : unsigned char {
4646
/// \brief No logging.

include/IndexStoreDB/Support/Path.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define INDEXSTOREDB_SUPPORT_PATH_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718
#include "llvm/ADT/SmallString.h"
1819
#include "llvm/Support/Path.h"
1920

@@ -77,7 +78,7 @@ class CanonicalFilePathRef {
7778
inline CanonicalFilePath::CanonicalFilePath(CanonicalFilePathRef CanonPath)
7879
: Path(CanonPath.getPath()) {}
7980

80-
class LLVM_EXPORT CanonicalPathCache {
81+
class INDEXSTOREDB_EXPORT CanonicalPathCache {
8182
void *Impl;
8283

8384
public:

include/IndexStoreDB/Support/PatternMatching.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
#define INDEXSTOREDB_SUPPORT_PATTERNMATCHING_H
1515

1616
#include "IndexStoreDB/Support/LLVM.h"
17+
#include "IndexStoreDB/Support/Visibility.h"
1718

1819
namespace IndexStoreDB {
1920

20-
LLVM_EXPORT
21+
INDEXSTOREDB_EXPORT
2122
bool matchesPattern(StringRef Input,
2223
StringRef Pattern,
2324
bool AnchorStart,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===--- Visibility.h ------------------------------------------*- C++ -*-===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef LLVM_INDEXSTOREDB_SUPPORT_VISIBILITY_H
14+
#define LLVM_INDEXSTOREDB_SUPPORT_VISIBILITY_H
15+
16+
#ifndef __has_attribute
17+
#define __has_attribute(x) 0
18+
#endif
19+
20+
#if __has_attribute(visibility)
21+
#define INDEXSTOREDB_EXPORT __attribute__ ((visibility("default")))
22+
#else
23+
#define INDEXSTOREDB_EXPORT
24+
#endif
25+
26+
#endif

0 commit comments

Comments
 (0)