mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Add SmallString::str (which returns a StringRef); this is more efficient than
c_str(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#define LLVM_ADT_SMALLSTRING_H
|
#define LLVM_ADT_SMALLSTRING_H
|
||||||
|
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
#include "llvm/ADT/StringRef.h"
|
||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
@@ -45,6 +46,8 @@ public:
|
|||||||
return this->begin();
|
return this->begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringRef str() const { return StringRef(this->begin(), this->size()); }
|
||||||
|
|
||||||
// Extra operators.
|
// Extra operators.
|
||||||
const SmallString &operator=(const char *RHS) {
|
const SmallString &operator=(const char *RHS) {
|
||||||
this->clear();
|
this->clear();
|
||||||
|
Reference in New Issue
Block a user