[llvm] 0841916 - [TableGen] Do not construct string from nullptr
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 07:42:28 PDT 2020
Author: Yuriy Chernyshov
Date: 2020-09-10T16:42:11+02:00
New Revision: 0841916e87a39e3c223c986e8da31e4a9a1432e3
URL: https://github.com/llvm/llvm-project/commit/0841916e87a39e3c223c986e8da31e4a9a1432e3
DIFF: https://github.com/llvm/llvm-project/commit/0841916e87a39e3c223c986e8da31e4a9a1432e3.diff
LOG: [TableGen] Do not construct string from nullptr
While I am trying to forbid such usages systematically in
https://reviews.llvm.org/D79427 / P2166R0 to C++ standard,
this PR fixes this (definitelly incorrect) usage in llvm.
Differential Revision: https://reviews.llvm.org/D87185
Added:
Modified:
llvm/utils/TableGen/DFAEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/DFAEmitter.cpp b/llvm/utils/TableGen/DFAEmitter.cpp
index 7391f6845a4b2..e877650852898 100644
--- a/llvm/utils/TableGen/DFAEmitter.cpp
+++ b/llvm/utils/TableGen/DFAEmitter.cpp
@@ -174,7 +174,7 @@ namespace {
struct Action {
Record *R = nullptr;
unsigned I = 0;
- std::string S = nullptr;
+ std::string S;
Action() = default;
Action(Record *R, unsigned I, std::string S) : R(R), I(I), S(S) {}
More information about the llvm-commits
mailing list