add GetSpellingFromOperator & GetOperatorFromSpelling#628
add GetSpellingFromOperator & GetOperatorFromSpelling#628Vipul-Cariappa merged 2 commits intocompiler-research:mainfrom
GetSpellingFromOperator & GetOperatorFromSpelling#628Conversation
610fbe8 to
2672ab1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #628 +/- ##
==========================================
+ Coverage 77.70% 77.77% +0.07%
==========================================
Files 9 9
Lines 3749 3761 +12
==========================================
+ Hits 2913 2925 +12
Misses 836 836
🚀 New features to boost your workflow:
|
vgvassilev
left a comment
There was a problem hiding this comment.
Awesome. Let's update the clients, too!
| } | ||
|
|
||
| std::string GetSpellingFromOperator(Operator Operator) { | ||
| return clang::getOperatorSpelling((clang::OverloadedOperatorKind)Operator); |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
auto* D = (clang::Decl*)func;
^| if ((Spelling) == op) { \ | ||
| return (Operator)OO_##Name; \ | ||
| } | ||
| #include "clang/Basic/OperatorKinds.def" |
There was a problem hiding this comment.
warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
return PI->getNameAsString();
^Additional context
lib/CppInterOp/CppInterOp.cpp:3564: 'PI' initialized to a null pointer value
clang::ParmVarDecl* PI = nullptr;
^lib/CppInterOp/CppInterOp.cpp:3566: Assuming null pointer is passed into cast
if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3566: 'FD' is null
if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3566: Taking false branch
if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3568: Assuming null pointer is passed into cast
else if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionTemplateDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3568: 'FD' is null
else if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionTemplateDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3568: Taking false branch
else if (auto* FD = llvm::dyn_cast_or_null<clang::FunctionTemplateDecl>(D))
^lib/CppInterOp/CppInterOp.cpp:3571: Called C++ object pointer is null
return PI->getNameAsString();
^Co-authored-by: mcbarton <matthew.c.barton@hotmail.co.uk>
Description
Please include a summary of changes, motivation and context for this PR.
Fixes # (issue)
Type of change
Please tick all options which are relevant.
Testing
Please describe the test(s) that you added and ran to verify your changes.
Checklist