[llvm-commits] [llvm] r73707 - in /llvm/trunk: include/llvm/Support/ManagedStatic.h include/llvm/Support/Threading.h include/llvm/System/Threading.h lib/Support/Threading.cpp lib/System/Threading.cpp lib/VMCore/Constants.cpp lib/VMCore/Function.cpp lib/VMCore/LeakDetector.cpp lib/VMCore/Pass.cpp lib/VMCore/PassManager.cpp lib/VMCore/Type.cpp lib/VMCore/TypeSymbolTable.cpp lib/VMCore/Value.cpp

Owen Anderson resistor at mac.com
Thu Jun 18 09:54:52 PDT 2009


Author: resistor
Date: Thu Jun 18 11:54:52 2009
New Revision: 73707

URL: http://llvm.org/viewvc/llvm-project?rev=73707&view=rev
Log:
Move Threading.[h|cpp] from Support to System.

Added:
    llvm/trunk/include/llvm/System/Threading.h
      - copied, changed from r73700, llvm/trunk/include/llvm/Support/Threading.h
    llvm/trunk/lib/System/Threading.cpp
      - copied, changed from r73700, llvm/trunk/lib/Support/Threading.cpp
Removed:
    llvm/trunk/include/llvm/Support/Threading.h
    llvm/trunk/lib/Support/Threading.cpp
Modified:
    llvm/trunk/include/llvm/Support/ManagedStatic.h
    llvm/trunk/lib/VMCore/Constants.cpp
    llvm/trunk/lib/VMCore/Function.cpp
    llvm/trunk/lib/VMCore/LeakDetector.cpp
    llvm/trunk/lib/VMCore/Pass.cpp
    llvm/trunk/lib/VMCore/PassManager.cpp
    llvm/trunk/lib/VMCore/Type.cpp
    llvm/trunk/lib/VMCore/TypeSymbolTable.cpp
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/include/llvm/Support/ManagedStatic.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ManagedStatic.h?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/ManagedStatic.h (original)
+++ llvm/trunk/include/llvm/Support/ManagedStatic.h Thu Jun 18 11:54:52 2009
@@ -15,7 +15,7 @@
 #define LLVM_SUPPORT_MANAGED_STATIC_H
 
 #include "llvm/System/Atomic.h"
-#include "llvm/Support/Threading.h"
+#include "llvm/System/Threading.h"
 
 namespace llvm {
 

Removed: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=73706&view=auto

==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h (removed)
@@ -1,45 +0,0 @@
-//===-- llvm/Support/Threading.h - Control multithreading mode --*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// TThis file defines llvm_start_multithreaded() and friends.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_THREADING_H
-#define LLVM_SUPPORT_THREADING_H
-
-namespace llvm {
-  /// llvm_start_multithreaded - Allocate and initialize structures needed to
-  /// make LLVM safe for multithreading.  The return value indicates whether
-  /// multithreaded initialization succeeded.  LLVM will still be operational
-  /// on "failed" return, and will still be safe for hosting threading 
-  /// applications in the JIT, but will not be safe for concurrent calls to the
-  /// LLVM APIs.
-  /// THIS MUST EXECUTE IN ISOLATION FROM ALL OTHER LLVM API CALLS.
-  bool llvm_start_multithreaded();
-  
-  /// llvm_stop_multithreaded - Deallocate structures necessary to make LLVM
-  /// safe for multithreading.
-  /// THIS MUST EXECUTE IN ISOLATION FROM ALL OTHER LLVM API CALLS.
-  void llvm_stop_multithreaded();
-  
-  /// llvm_is_multithreaded - Check whether LLVM is executing in thread-safe
-  /// mode or not.
-  bool llvm_is_multithreaded();
-  
-  /// acquire_global_lock - Acquire the global lock.  This is a no-op if called
-  /// before llvm_start_multithreaded().
-  void llvm_acquire_global_lock();
-  
-  /// release_global_lock - Release the global lock.  This is a no-op if called
-  /// before llvm_start_multithreaded().
-  void llvm_release_global_lock();
-}
-
-#endif

Copied: llvm/trunk/include/llvm/System/Threading.h (from r73700, llvm/trunk/include/llvm/Support/Threading.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Threading.h?p2=llvm/trunk/include/llvm/System/Threading.h&p1=llvm/trunk/include/llvm/Support/Threading.h&r1=73700&r2=73707&rev=73707&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/System/Threading.h Thu Jun 18 11:54:52 2009
@@ -1,4 +1,4 @@
-//===-- llvm/Support/Threading.h - Control multithreading mode --*- C++ -*-===//
+//===-- llvm/System/Threading.h - Control multithreading mode --*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_SUPPORT_THREADING_H
-#define LLVM_SUPPORT_THREADING_H
+#ifndef LLVM_SYSTEM_THREADING_H
+#define LLVM_SYSTEM_THREADING_H
 
 namespace llvm {
   /// llvm_start_multithreaded - Allocate and initialize structures needed to

Removed: llvm/trunk/lib/Support/Threading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Threading.cpp?rev=73706&view=auto

==============================================================================
--- llvm/trunk/lib/Support/Threading.cpp (original)
+++ llvm/trunk/lib/Support/Threading.cpp (removed)
@@ -1,63 +0,0 @@
-//===-- llvm/Support/Threading.cpp- Control multithreading mode --*- C++ -*-==//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements llvm_start_multithreaded() and friends.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Threading.h"
-#include "llvm/System/Atomic.h"
-#include "llvm/System/Mutex.h"
-#include <cassert>
-
-using namespace llvm;
-
-static bool multithreaded_mode = false;
-
-static sys::Mutex* global_lock = 0;
-
-bool llvm::llvm_start_multithreaded() {
-#ifdef LLVM_MULTITHREADED
-  assert(!multithreaded_mode && "Already multithreaded!");
-  multithreaded_mode = true;
-  global_lock = new sys::Mutex(true);
-  
-  // We fence here to ensure that all initialization is complete BEFORE we
-  // return from llvm_start_multithreaded().
-  sys::MemoryFence();
-  return true;
-#else
-  return false;
-#endif
-}
-
-void llvm::llvm_stop_multithreaded() {
-#ifdef LLVM_MULTITHREADED
-  assert(multithreaded_mode && "Not currently multithreaded!");
-  
-  // We fence here to insure that all threaded operations are complete BEFORE we
-  // return from llvm_stop_multithreaded().
-  sys::MemoryFence();
-  
-  multithreaded_mode = false;
-  delete global_lock;
-#endif
-}
-
-bool llvm::llvm_is_multithreaded() {
-  return multithreaded_mode;
-}
-
-void llvm::llvm_acquire_global_lock() {
-  if (multithreaded_mode) global_lock->acquire();
-}
-
-void llvm::llvm_release_global_lock() {
-  if (multithreaded_mode) global_lock->release();
-}

Copied: llvm/trunk/lib/System/Threading.cpp (from r73700, llvm/trunk/lib/Support/Threading.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Threading.cpp?p2=llvm/trunk/lib/System/Threading.cpp&p1=llvm/trunk/lib/Support/Threading.cpp&r1=73700&r2=73707&rev=73707&view=diff

==============================================================================
--- llvm/trunk/lib/Support/Threading.cpp (original)
+++ llvm/trunk/lib/System/Threading.cpp Thu Jun 18 11:54:52 2009
@@ -1,4 +1,4 @@
-//===-- llvm/Support/Threading.cpp- Control multithreading mode --*- C++ -*-==//
+//===-- llvm/System/Threading.cpp- Control multithreading mode --*- C++ -*-==//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Support/Threading.h"
+#include "llvm/System/Threading.h"
 #include "llvm/System/Atomic.h"
 #include "llvm/System/Mutex.h"
 #include <cassert>

Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Thu Jun 18 11:54:52 2009
@@ -25,8 +25,8 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include <algorithm>

Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Thu Jun 18 11:54:52 2009
@@ -18,8 +18,8 @@
 #include "llvm/Support/LeakDetector.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/StringPool.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include "SymbolTableListTraitsImpl.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringExtras.h"

Modified: llvm/trunk/lib/VMCore/LeakDetector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LeakDetector.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/LeakDetector.cpp (original)
+++ llvm/trunk/lib/VMCore/LeakDetector.cpp Thu Jun 18 11:54:52 2009
@@ -16,8 +16,8 @@
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Streams.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include "llvm/Value.h"
 using namespace llvm;
 

Modified: llvm/trunk/lib/VMCore/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Pass.cpp (original)
+++ llvm/trunk/lib/VMCore/Pass.cpp Thu Jun 18 11:54:52 2009
@@ -19,8 +19,8 @@
 #include "llvm/ModuleProvider.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/Atomic.h"
+#include "llvm/System/Threading.h"
 #include <algorithm>
 #include <map>
 #include <set>

Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Thu Jun 18 11:54:52 2009
@@ -20,8 +20,8 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/Mutex.h"
+#include "llvm/System/Threading.h"
 #include "llvm/Analysis/Dominators.h"
 #include "llvm-c/Core.h"
 #include <algorithm>

Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Thu Jun 18 11:54:52 2009
@@ -23,9 +23,9 @@
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/Mutex.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include <algorithm>
 #include <cstdarg>
 using namespace llvm;

Modified: llvm/trunk/lib/VMCore/TypeSymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/TypeSymbolTable.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/TypeSymbolTable.cpp (original)
+++ llvm/trunk/lib/VMCore/TypeSymbolTable.cpp Thu Jun 18 11:54:52 2009
@@ -16,8 +16,8 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Streams.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include <algorithm>
 using namespace llvm;
 

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=73707&r1=73706&r2=73707&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Thu Jun 18 11:54:52 2009
@@ -21,9 +21,9 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/LeakDetector.h"
 #include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Threading.h"
 #include "llvm/Support/ValueHandle.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/System/Threading.h"
 #include "llvm/ADT/DenseMap.h"
 #include <algorithm>
 using namespace llvm;





More information about the llvm-commits mailing list