diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-11-02 20:01:13 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-11-02 20:01:13 +0000 |
commit | 5c6a6f6ad5c30c14b26d38f7a22ce1999a9c1557 (patch) | |
tree | 6003b38948ca33616a915cc14fb23e186128b7a7 /include | |
parent | a0fd526ce8022428904a025eb2e1b86cf27d22b6 (diff) |
StringRef-ify DiagnosticInfoSampleProfile::Filename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/DiagnosticInfo.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/llvm/IR/DiagnosticInfo.h b/include/llvm/IR/DiagnosticInfo.h index 8ed65c0dd39..aac7a4509f3 100644 --- a/include/llvm/IR/DiagnosticInfo.h +++ b/include/llvm/IR/DiagnosticInfo.h @@ -214,19 +214,18 @@ public: /// Diagnostic information for the sample profiler. class DiagnosticInfoSampleProfile : public DiagnosticInfo { public: - DiagnosticInfoSampleProfile(const char *FileName, unsigned LineNum, + DiagnosticInfoSampleProfile(StringRef FileName, unsigned LineNum, const Twine &Msg, DiagnosticSeverity Severity = DS_Error) : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName), LineNum(LineNum), Msg(Msg) {} - DiagnosticInfoSampleProfile(const char *FileName, const Twine &Msg, + DiagnosticInfoSampleProfile(StringRef FileName, const Twine &Msg, DiagnosticSeverity Severity = DS_Error) : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName), LineNum(0), Msg(Msg) {} DiagnosticInfoSampleProfile(const Twine &Msg, DiagnosticSeverity Severity = DS_Error) - : DiagnosticInfo(DK_SampleProfile, Severity), FileName(nullptr), - LineNum(0), Msg(Msg) {} + : DiagnosticInfo(DK_SampleProfile, Severity), LineNum(0), Msg(Msg) {} /// \see DiagnosticInfo::print. void print(DiagnosticPrinter &DP) const override; @@ -235,13 +234,13 @@ public: return DI->getKind() == DK_SampleProfile; } - const char *getFileName() const { return FileName; } + StringRef getFileName() const { return FileName; } unsigned getLineNum() const { return LineNum; } const Twine &getMsg() const { return Msg; } private: /// Name of the input file associated with this diagnostic. - const char *FileName; + StringRef FileName; /// Line number where the diagnostic occurred. If 0, no line number will /// be emitted in the message. |