forked from OSchip/llvm-project
parent
692ac46a70
commit
6ba9d4483f
|
@ -15,7 +15,6 @@
|
||||||
#define LLVM_ADT_STRINGSET_H
|
#define LLVM_ADT_STRINGSET_H
|
||||||
|
|
||||||
#include "llvm/ADT/StringMap.h"
|
#include "llvm/ADT/StringMap.h"
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
@ -26,10 +25,10 @@ namespace llvm {
|
||||||
class StringSet : public llvm::StringMap<char, AllocatorTy> {
|
class StringSet : public llvm::StringMap<char, AllocatorTy> {
|
||||||
typedef llvm::StringMap<char, AllocatorTy> base;
|
typedef llvm::StringMap<char, AllocatorTy> base;
|
||||||
public:
|
public:
|
||||||
bool insert(const std::string& InLang) {
|
bool insert(StringRef InLang) {
|
||||||
assert(!InLang.empty());
|
assert(!InLang.empty());
|
||||||
const char* KeyStart = &InLang[0];
|
const char *KeyStart = InLang.data();
|
||||||
const char* KeyEnd = KeyStart + InLang.size();
|
const char *KeyEnd = KeyStart + InLang.size();
|
||||||
return base::insert(llvm::StringMapEntry<char>::
|
return base::insert(llvm::StringMapEntry<char>::
|
||||||
Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
|
Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue