LLVM
3.7.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
work
release_test
rc4
llvm.src
lib
Target
NVPTX
ManagedStringPool.h
Go to the documentation of this file.
1
//===-- ManagedStringPool.h - Managed String Pool ---------------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// The strings allocated from a managed string pool are owned by the string
11
// pool and will be deleted together with the managed string pool.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_LIB_TARGET_NVPTX_MANAGEDSTRINGPOOL_H
16
#define LLVM_LIB_TARGET_NVPTX_MANAGEDSTRINGPOOL_H
17
18
#include "
llvm/ADT/SmallVector.h
"
19
#include <string>
20
21
namespace
llvm {
22
23
/// ManagedStringPool - The strings allocated from a managed string pool are
24
/// owned by the string pool and will be deleted together with the managed
25
/// string pool.
26
class
ManagedStringPool
{
27
SmallVector<std::string *, 8>
Pool;
28
29
public
:
30
ManagedStringPool
() {}
31
~ManagedStringPool
() {
32
SmallVectorImpl<std::string *>::iterator
Current = Pool.
begin
();
33
while
(Current != Pool.
end
()) {
34
delete
*Current;
35
Current++;
36
}
37
}
38
39
std::string *
getManagedString
(
const
char
*S) {
40
std::string *Str =
new
std::string(S);
41
Pool.
push_back
(Str);
42
return
Str;
43
}
44
};
45
46
}
47
48
#endif
llvm::SmallVectorTemplateCommon::end
iterator end()
Definition:
SmallVector.h:114
llvm::SmallVectorTemplateBase::push_back
void push_back(const T &Elt)
Definition:
SmallVector.h:222
llvm::ManagedStringPool
ManagedStringPool - The strings allocated from a managed string pool are owned by the string pool and...
Definition:
ManagedStringPool.h:26
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:
APInt.h:33
llvm::ManagedStringPool::getManagedString
std::string * getManagedString(const char *S)
Definition:
ManagedStringPool.h:39
llvm::SmallVector< std::string *, 8 >
llvm::ManagedStringPool::ManagedStringPool
ManagedStringPool()
Definition:
ManagedStringPool.h:30
llvm::SmallVectorTemplateCommon::begin
iterator begin()
Definition:
SmallVector.h:112
llvm::ManagedStringPool::~ManagedStringPool
~ManagedStringPool()
Definition:
ManagedStringPool.h:31
SmallVector.h
Generated on Mon Aug 31 2015 11:04:04 for LLVM by
1.8.6