Skip to content

Remove LLVM_EXPORT references #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/IndexStoreDB/Database/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@

#include "IndexStoreDB/Database/IDCode.h"
#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include <memory>

namespace IndexStoreDB {
namespace db {
class Database;
typedef std::shared_ptr<Database> DatabaseRef;

class LLVM_EXPORT Database {
class INDEXSTOREDB_EXPORT Database {
public:
static DatabaseRef create(StringRef dbPath, bool readonly, Optional<size_t> initialDBSize, std::string &error);
~Database();
Expand All @@ -43,7 +44,7 @@ class LLVM_EXPORT Database {
static const unsigned DATABASE_FORMAT_VERSION;
};

LLVM_EXPORT IDCode makeIDCodeFromString(StringRef name);
INDEXSTOREDB_EXPORT IDCode makeIDCodeFromString(StringRef name);

} // namespace db
} // namespace IndexStoreDB
Expand Down
6 changes: 3 additions & 3 deletions include/IndexStoreDB/Database/DatabaseError.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#ifndef INDEXSTOREDB_SKDATABASE_DATABASEERROR_H
#define INDEXSTOREDB_SKDATABASE_DATABASEERROR_H

#include "llvm/Support/Compiler.h"
#include "IndexStoreDB/Support/Visibility.h"
#include <string>
#include <stdexcept>

namespace IndexStoreDB {
namespace db {

class LLVM_EXPORT DatabaseError : public std::runtime_error {
class INDEXSTOREDB_EXPORT DatabaseError : public std::runtime_error {
protected:
const int _code;

Expand Down Expand Up @@ -51,7 +51,7 @@ class LLVM_EXPORT DatabaseError : public std::runtime_error {
///
/// @see http://symas.com/mdb/doc/group__errors.html#ga0a83370402a060c9175100d4bbfb9f25
///
class LLVM_EXPORT MapFullError final : public DatabaseError {
class INDEXSTOREDB_EXPORT MapFullError final : public DatabaseError {
virtual void _anchor();
public:
using DatabaseError::DatabaseError;
Expand Down
4 changes: 2 additions & 2 deletions include/IndexStoreDB/Database/ImportTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace db {
class Database;
typedef std::shared_ptr<Database> DatabaseRef;

class LLVM_EXPORT ImportTransaction {
class INDEXSTOREDB_EXPORT ImportTransaction {
public:
explicit ImportTransaction(DatabaseRef dbase);
~ImportTransaction();
Expand All @@ -48,7 +48,7 @@ class LLVM_EXPORT ImportTransaction {
std::unique_ptr<Implementation> Impl;
};

class LLVM_EXPORT UnitDataImport {
class INDEXSTOREDB_EXPORT UnitDataImport {
ImportTransaction &Import;
std::string UnitName;
CanonicalFilePath MainFile;
Expand Down
2 changes: 1 addition & 1 deletion include/IndexStoreDB/Database/ReadTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace db {
class Database;
typedef std::shared_ptr<Database> DatabaseRef;

class LLVM_EXPORT ReadTransaction {
class INDEXSTOREDB_EXPORT ReadTransaction {
public:
explicit ReadTransaction(DatabaseRef dbase);
~ReadTransaction();
Expand Down
7 changes: 4 additions & 3 deletions include/IndexStoreDB/Index/IndexStoreLibraryProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define INDEXSTOREDB_INDEX_SYMBOLDATAPROVIDER_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/StringRef.h"
#include <memory>

Expand All @@ -29,7 +30,7 @@ namespace index {
using IndexStoreLibrary = ::indexstore::IndexStoreLibrary;
using IndexStoreLibraryRef = ::indexstore::IndexStoreLibraryRef;

class LLVM_EXPORT IndexStoreLibraryProvider {
class INDEXSTOREDB_EXPORT IndexStoreLibraryProvider {
public:
virtual ~IndexStoreLibraryProvider() {}

Expand All @@ -41,12 +42,12 @@ class LLVM_EXPORT IndexStoreLibraryProvider {
};

/// A simple library provider that can be used if libIndexStore is linked to your binary.
class LLVM_EXPORT GlobalIndexStoreLibraryProvider: public IndexStoreLibraryProvider {
class INDEXSTOREDB_EXPORT GlobalIndexStoreLibraryProvider: public IndexStoreLibraryProvider {
public:
IndexStoreLibraryRef getLibraryForStorePath(StringRef storePath) override;
};

LLVM_EXPORT IndexStoreLibraryRef loadIndexStoreLibrary(std::string dylibPath,
INDEXSTOREDB_EXPORT IndexStoreLibraryRef loadIndexStoreLibrary(std::string dylibPath,
std::string &error);

} // namespace index
Expand Down
3 changes: 2 additions & 1 deletion include/IndexStoreDB/Index/IndexSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define INDEXSTOREDB_INDEX_INDEXSYSTEM_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/OptionSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Chrono.h"
Expand All @@ -37,7 +38,7 @@ namespace index {
struct StoreUnitInfo;
class IndexStoreLibraryProvider;

class LLVM_EXPORT IndexSystem {
class INDEXSTOREDB_EXPORT IndexSystem {
public:
~IndexSystem();

Expand Down
2 changes: 1 addition & 1 deletion include/IndexStoreDB/Index/IndexSystemDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DependentUnitOutOfDateTriggerHint : public OutOfDateTriggerHint {
virtual std::string description() override;
};

class LLVM_EXPORT IndexSystemDelegate {
class INDEXSTOREDB_EXPORT IndexSystemDelegate {
public:
virtual ~IndexSystemDelegate() {}

Expand Down
3 changes: 2 additions & 1 deletion include/IndexStoreDB/Support/Concurrency.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
#ifndef LLVM_INDEXSTOREDB_SUPPORT_CONCURRENCY_H
#define LLVM_INDEXSTOREDB_SUPPORT_CONCURRENCY_H

#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/StringRef.h"

namespace IndexStoreDB {

class LLVM_EXPORT WorkQueue {
class INDEXSTOREDB_EXPORT WorkQueue {
public:
enum class Dequeuing {
Serial,
Expand Down
3 changes: 2 additions & 1 deletion include/IndexStoreDB/Support/FilePathWatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
#define INDEXSTOREDB_SUPPORT_FILEPATHWATCHER_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include <functional>

namespace IndexStoreDB {

class LLVM_EXPORT FilePathWatcher {
class INDEXSTOREDB_EXPORT FilePathWatcher {
struct Implementation;

public:
Expand Down
6 changes: 3 additions & 3 deletions include/IndexStoreDB/Support/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#define LLVM_INDEXSTOREDB_SUPPORT_LOGGING_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Timer.h"
#include <string>
Expand All @@ -29,7 +29,7 @@ class format_object_base;
namespace IndexStoreDB {
class Logger;

LLVM_EXPORT void writeEscaped(StringRef Str, raw_ostream &OS);
INDEXSTOREDB_EXPORT void writeEscaped(StringRef Str, raw_ostream &OS);

typedef IntrusiveRefCntPtr<Logger> LogRef;

Expand All @@ -40,7 +40,7 @@ typedef IntrusiveRefCntPtr<Logger> LogRef;
/// *Log << "stuff";
/// }
/// \endcode
class LLVM_EXPORT Logger : public llvm::ThreadSafeRefCountedBase<Logger> {
class INDEXSTOREDB_EXPORT Logger : public llvm::ThreadSafeRefCountedBase<Logger> {
public:
enum class Level : unsigned char {
/// \brief No logging.
Expand Down
3 changes: 2 additions & 1 deletion include/IndexStoreDB/Support/Path.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define INDEXSTOREDB_SUPPORT_PATH_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"

Expand Down Expand Up @@ -77,7 +78,7 @@ class CanonicalFilePathRef {
inline CanonicalFilePath::CanonicalFilePath(CanonicalFilePathRef CanonPath)
: Path(CanonPath.getPath()) {}

class LLVM_EXPORT CanonicalPathCache {
class INDEXSTOREDB_EXPORT CanonicalPathCache {
void *Impl;

public:
Expand Down
3 changes: 2 additions & 1 deletion include/IndexStoreDB/Support/PatternMatching.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#define INDEXSTOREDB_SUPPORT_PATTERNMATCHING_H

#include "IndexStoreDB/Support/LLVM.h"
#include "IndexStoreDB/Support/Visibility.h"

namespace IndexStoreDB {

LLVM_EXPORT
INDEXSTOREDB_EXPORT
bool matchesPattern(StringRef Input,
StringRef Pattern,
bool AnchorStart,
Expand Down
26 changes: 26 additions & 0 deletions include/IndexStoreDB/Support/Visibility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//===--- Visibility.h ------------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_INDEXSTOREDB_SUPPORT_VISIBILITY_H
#define LLVM_INDEXSTOREDB_SUPPORT_VISIBILITY_H

#ifndef __has_attribute
#define __has_attribute(x) 0
#endif

#if __has_attribute(visibility)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#ifndef __has_attribute
#define __has_attribute(x) 0
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, added.

#define INDEXSTOREDB_EXPORT __attribute__ ((visibility("default")))
#else
#define INDEXSTOREDB_EXPORT
#endif

#endif