1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Add SmallString::str (which returns a StringRef); this is more efficient than

c_str().

llvm-svn: 79453
This commit is contained in:
Daniel Dunbar 2009-08-19 19:57:55 +00:00
parent 15b0649d13
commit cb45b94032

View File

@ -15,6 +15,7 @@
#define LLVM_ADT_SMALLSTRING_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
#include <cstring>
@ -45,6 +46,8 @@ public:
return this->begin();
}
StringRef str() const { return StringRef(this->begin(), this->size()); }
// Extra operators.
const SmallString &operator=(const char *RHS) {
this->clear();