1 //===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open
6 // Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // StringSet - A set-like wrapper for the StringMap.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_ADT_STRINGSET_H
15 #define LLVM_ADT_STRINGSET_H
17 #include "llvm/ADT/StringMap.h"
21 /// StringSet - A wrapper for StringMap that provides set-like functionality.
22 template <class AllocatorTy = llvm::MallocAllocator>
23 class StringSet : public llvm::StringMap<char, AllocatorTy> {
24 typedef llvm::StringMap<char, AllocatorTy> base;
27 std::pair<typename base::iterator, bool> insert(StringRef Key) {
29 return base::insert(std::make_pair(Key, '\0'));
34 #endif // LLVM_ADT_STRINGSET_H