summaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index e536322..cf87989 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -43,8 +43,10 @@ protected:
public:
static MDString *get(LLVMContext &Context, StringRef Str);
- static MDString *get(LLVMContext &Context, const char *Str);
-
+ static MDString *get(LLVMContext &Context, const char *Str) {
+ return get(Context, Str ? StringRef(Str) : StringRef());
+ }
+
StringRef getString() const { return Str; }
unsigned getLength() const { return (unsigned)Str.size(); }
OpenPOWER on IntegriCloud