diff options
Diffstat (limited to 'lib/IR/LLVMContextImpl.cpp')
| -rw-r--r-- | lib/IR/LLVMContextImpl.cpp | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/IR/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp index c19e1be44fdc7..57dd08b36fe70 100644 --- a/lib/IR/LLVMContextImpl.cpp +++ b/lib/IR/LLVMContextImpl.cpp @@ -205,6 +205,20 @@ uint32_t LLVMContextImpl::getOperandBundleTagID(StringRef Tag) const {    return I->second;  } +SyncScope::ID LLVMContextImpl::getOrInsertSyncScopeID(StringRef SSN) { +  auto NewSSID = SSC.size(); +  assert(NewSSID < std::numeric_limits<SyncScope::ID>::max() && +         "Hit the maximum number of synchronization scopes allowed!"); +  return SSC.insert(std::make_pair(SSN, SyncScope::ID(NewSSID))).first->second; +} + +void LLVMContextImpl::getSyncScopeNames( +    SmallVectorImpl<StringRef> &SSNs) const { +  SSNs.resize(SSC.size()); +  for (const auto &SSE : SSC) +    SSNs[SSE.second] = SSE.first(); +} +  /// Singleton instance of the OptBisect class.  ///  /// This singleton is accessed via the LLVMContext::getOptBisect() function.  It  | 
