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:
9a0b6e6
)
Create empty StringRef is incoming cstring is NULL.
author
Devang Patel
<dpatel@apple.com>
Tue, 29 Sep 2009 18:39:56 +0000
(18:39 +0000)
committer
Devang Patel
<dpatel@apple.com>
Tue, 29 Sep 2009 18:39:56 +0000
(18:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83082
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/StringRef.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/StringRef.h
b/include/llvm/ADT/StringRef.h
index e4fd258cb87182ef27a6c01e0ec5554f2eb4ff41..30379a38f46fdb9d31d7d43130380d1aa7cd8e5a 100644
(file)
--- a/
include/llvm/ADT/StringRef.h
+++ b/
include/llvm/ADT/StringRef.h
@@
-46,7
+46,7
@@
namespace llvm {
/// Construct a string ref from a cstring.
/*implicit*/ StringRef(const char *Str)
- : Data(Str)
, Length(::strlen(Str)) {
}
+ : Data(Str)
{ if (Str) Length = ::strlen(Str); else Length = 0;
}
/// Construct a string ref from a pointer and length.
/*implicit*/ StringRef(const char *_Data, unsigned _Length)