Taints the non-acquire RMW's store address with the load part
[oota-llvm.git] / include / llvm / ADT / StringSet.h
index 685f8961439d739de60f7973ff43ed813f75d058..08626dc7af84ce878e3b7804e71e5190bff00cf7 100644 (file)
 
 #include "llvm/ADT/StringMap.h"
 
-#include <cassert>
-
 namespace llvm {
 
-  /// StringSet - A wrapper for StringMap that provides set-like
-  /// functionality.  Only insert() and count() methods are used by my
-  /// code.
+  /// StringSet - A wrapper for StringMap that provides set-like functionality.
   template <class AllocatorTy = llvm::MallocAllocator>
   class StringSet : public llvm::StringMap<char, AllocatorTy> {
     typedef llvm::StringMap<char, AllocatorTy> base;
   public:
-    bool insert (const std::string& InLang) {
-      assert(!InLang.empty());
-      const char* KeyStart = &InLang[0];
-      const char* KeyEnd = KeyStart + InLang.size();
-      return base::insert(llvm::StringMapEntry<char>::
-                          Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
+    StringSet() = default;
+    StringSet(std::initializer_list<StringRef> S) {
+      for (StringRef X : S)
+        insert(X);
+    }
+
+    std::pair<typename base::iterator, bool> insert(StringRef Key) {
+      assert(!Key.empty());
+      return base::insert(std::make_pair(Key, '\0'));
     }
   };
 }