Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 0 additions & 12 deletions common_clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Copyright (c) Intel Corporation (2009-2017).
#include "llvm/Support/Path.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Diagnostic.h"
Expand Down Expand Up @@ -81,8 +80,6 @@ Copyright (c) Intel Corporation (2009-2017).

using namespace Intel::OpenCL::ClangFE;

llvm::ManagedStatic<llvm::sys::SmartMutex<true>> compileMutex;

void CommonClangTerminate() { llvm::llvm_shutdown(); }

// This function mustn't be invoked from a static object constructor,
Expand Down Expand Up @@ -198,9 +195,6 @@ Compile(const char *pszProgramSource, const char **pInputHeaders,
CommonClangInitialize();

try {
#ifdef _WIN32
llvm::sys::SmartScopedLock<true> compileGuard{*compileMutex};
#endif
std::unique_ptr<OCLFEBinaryResult> pResult(new OCLFEBinaryResult());

// Create the clang compiler
Expand All @@ -212,9 +206,6 @@ Compile(const char *pszProgramSource, const char **pInputHeaders,
// Prepare error log
llvm::raw_string_ostream err_ostream(pResult->getLogRef());
{
#ifndef _WIN32
llvm::sys::SmartScopedLock<true> compileGuard{*compileMutex};
#endif
// Parse options
if (optionsParser.processOptions(pszOptions, pszOptionsEx) != 0) {
if (pBinaryResult)
Expand Down Expand Up @@ -339,9 +330,6 @@ Compile(const char *pszProgramSource, const char **pInputHeaders,
err_ostream.flush();
}
{
#ifndef _WIN32
llvm::sys::SmartScopedLock<true> compileGuard{*compileMutex};
#endif
if (pBinaryResult) {
*pBinaryResult = pResult.release();
}
Expand Down
6 changes: 0 additions & 6 deletions options_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Copyright (c) Intel Corporation (2009-2017).

using namespace llvm::opt;

extern llvm::ManagedStatic<llvm::sys::SmartMutex<true>> compileMutex;

static const OptTable::Info ClangOptionsInfoTable[] = {
#define PREFIX(NAME, VALUE)
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
Expand Down Expand Up @@ -522,10 +520,6 @@ std::string CompileOptionsParser::getEffectiveOptionsAsString() const {
extern "C" CC_DLL_EXPORT bool CheckCompileOptions(const char *pszOptions,
char *pszUnknownOptions,
size_t uiUnknownOptionsSize) {
// LLVM doesn't guarantee thread safety,
// therefore we serialize execution of LLVM code.
llvm::sys::SmartScopedLock<true> compileOptionsGuard{*compileMutex};

try {
CompileOptionsParser optionsParser("200");
return optionsParser.checkOptions(pszOptions, pszUnknownOptions,
Expand Down
Loading