mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Provide guards for this shared structure. I'm not sure this actually needs
to be shared, but how/where to privatize it is not immediately clear to me. If any SelectionDAG experts see a better solution, please share! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,8 +31,10 @@
|
|||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
#include "llvm/System/Mutex.h"
|
||||||
#include "llvm/ADT/SetVector.h"
|
#include "llvm/ADT/SetVector.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
@@ -4977,14 +4979,17 @@ void SDNode::Profile(FoldingSetNodeID &ID) const {
|
|||||||
AddNodeIDNode(ID, this);
|
AddNodeIDNode(ID, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ManagedStatic<std::set<MVT, MVT::compareRawBits> > EVTs;
|
||||||
|
static MVT VTs[MVT::LAST_VALUETYPE];
|
||||||
|
static ManagedStatic<sys::SmartMutex<true> > VTMutex;
|
||||||
|
|
||||||
/// getValueTypeList - Return a pointer to the specified value type.
|
/// getValueTypeList - Return a pointer to the specified value type.
|
||||||
///
|
///
|
||||||
const MVT *SDNode::getValueTypeList(MVT VT) {
|
const MVT *SDNode::getValueTypeList(MVT VT) {
|
||||||
|
sys::SmartScopedLock<true> Lock(&*VTMutex);
|
||||||
if (VT.isExtended()) {
|
if (VT.isExtended()) {
|
||||||
static std::set<MVT, MVT::compareRawBits> EVTs;
|
return &(*EVTs->insert(VT).first);
|
||||||
return &(*EVTs.insert(VT).first);
|
|
||||||
} else {
|
} else {
|
||||||
static MVT VTs[MVT::LAST_VALUETYPE];
|
|
||||||
VTs[VT.getSimpleVT()] = VT;
|
VTs[VT.getSimpleVT()] = VT;
|
||||||
return &VTs[VT.getSimpleVT()];
|
return &VTs[VT.getSimpleVT()];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user