projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80bf1d5
)
Allow SmallString to implicitly convert to StringRef.
author
Daniel Dunbar
<daniel@zuster.org>
Sat, 21 Nov 2009 02:01:24 +0000
(
02:01
+0000)
committer
Daniel Dunbar
<daniel@zuster.org>
Sat, 21 Nov 2009 02:01:24 +0000
(
02:01
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89529
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/SmallString.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/SmallString.h
b/include/llvm/ADT/SmallString.h
index 035462515a83e96d1a1e5be3edb89ff80fc0e7a6..05bd8a42c67f650c967e3212298deb3dda111b9a 100644
(file)
--- a/
include/llvm/ADT/SmallString.h
+++ b/
include/llvm/ADT/SmallString.h
@@
-38,12
+38,15
@@
public:
// Extra methods.
StringRef str() const { return StringRef(this->begin(), this->size()); }
+ // Implicit conversion to StringRef.
+ operator StringRef() const { return str(); }
+
const char *c_str() {
this->push_back(0);
this->pop_back();
return this->data();
}
-
+
// Extra operators.
const SmallString &operator=(StringRef RHS) {
this->clear();