[llvm] r283012 - DIFlags: use StringRef instead of raw pointer (NFC)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 22:57:51 PDT 2016
Author: mehdi_amini
Date: Sat Oct 1 00:57:50 2016
New Revision: 283012
URL: http://llvm.org/viewvc/llvm-project?rev=283012&view=rev
Log:
DIFlags: use StringRef instead of raw pointer (NFC)
Modified:
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
llvm/trunk/lib/IR/AsmWriter.cpp
llvm/trunk/lib/IR/DebugInfoMetadata.cpp
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=283012&r1=283011&r2=283012&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Sat Oct 1 00:57:50 2016
@@ -183,7 +183,7 @@ public:
};
static DIFlags getFlag(StringRef Flag);
- static const char *getFlagString(DIFlags Flag);
+ static StringRef getFlagString(DIFlags Flag);
/// \brief Split up a flags bitfield.
///
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=283012&r1=283011&r2=283012&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Sat Oct 1 00:57:50 2016
@@ -1488,8 +1488,8 @@ void MDFieldPrinter::printDIFlags(String
FieldSeparator FlagsFS(" | ");
for (auto F : SplitFlags) {
- const char *StringF = DINode::getFlagString(F);
- assert(StringF && "Expected valid flag");
+ auto StringF = DINode::getFlagString(F);
+ assert(!StringF.empty() && "Expected valid flag");
Out << FlagsFS << StringF;
}
if (Extra || SplitFlags.empty())
Modified: llvm/trunk/lib/IR/DebugInfoMetadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=283012&r1=283011&r2=283012&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfoMetadata.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfoMetadata.cpp Sat Oct 1 00:57:50 2016
@@ -72,7 +72,7 @@ DINode::DIFlags DINode::getFlag(StringRe
.Default(DINode::FlagZero);
}
-const char *DINode::getFlagString(DIFlags Flag) {
+StringRef DINode::getFlagString(DIFlags Flag) {
switch (Flag) {
#define HANDLE_DI_FLAG(ID, NAME) \
case Flag##NAME: \
More information about the llvm-commits
mailing list