Use getOperatorSpelling to get the spelling of an overloaded operator
rather than duplicating operator name tables in multiple places.
llvm-svn: 363446
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 65532ec..73dcdc6 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -1640,14 +1640,8 @@
if (!D->isInvalidDecl()) {
Out << "#pragma omp declare reduction (";
if (D->getDeclName().getNameKind() == DeclarationName::CXXOperatorName) {
- static const char *const OperatorNames[NUM_OVERLOADED_OPERATORS] = {
- nullptr,
-#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly) \
- Spelling,
-#include "clang/Basic/OperatorKinds.def"
- };
const char *OpName =
- OperatorNames[D->getDeclName().getCXXOverloadedOperator()];
+ getOperatorSpelling(D->getDeclName().getCXXOverloadedOperator());
assert(OpName && "not an overloaded operator");
Out << OpName;
} else {