-
Couldn't load subscription status.
- Fork 35
Revert Thread-Safety #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert Thread-Safety #729
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #729 +/- ##
==========================================
- Coverage 81.03% 79.83% -1.21%
==========================================
Files 9 9
Lines 4214 3963 -251
==========================================
- Hits 3415 3164 -251
Misses 799 799
... and 2 files with indirect coverage changes
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 21. Check the log or trigger a new build to see more.
| return getInterpInfo(D).Interpreter->getSema(); | ||
| } | ||
| static clang::Sema& getSema(const void* D) { return getInterp(D).getSema(); } | ||
| static llvm::ManagedStatic<std::deque<InterpreterInfo>> sInterpreters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'sInterpreters' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static llvm::ManagedStatic<std::deque<InterpreterInfo>> sInterpreters;
^| return GetGlobalScope(); | ||
|
|
||
| auto* ND = static_cast<NamedDecl*>(GetNamed(name, parent, interp)); | ||
| auto* ND = (NamedDecl*)GetNamed(name, parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
auto* ND = (NamedDecl*)GetNamed(name, parent);
^| auto* Within = llvm::dyn_cast<clang::DeclContext>(D); | ||
| TCppScope_t GetNamed(const std::string& name, | ||
| TCppScope_t parent /*= nullptr*/) { | ||
| clang::DeclContext* Within = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| clang::DeclContext* Within = 0; | |
| clang::DeclContext* Within = nullptr; |
| TCppScope_t parent /*= nullptr*/) { | ||
| clang::DeclContext* Within = 0; | ||
| if (parent) { | ||
| auto* D = (clang::Decl*)parent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
auto* D = (clang::Decl*)parent;
^| } | ||
|
|
||
| auto* ND = Cpp_utils::Lookup::Named(&getSema(D), name, Within); | ||
| auto* ND = Cpp_utils::Lookup::Named(&getSema(), name, Within); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "Cpp::utils::Lookup::Named" is directly included [misc-include-cleaner]
lib/CppInterOp/CppInterOp.cpp:12:
+ #include "CppInterOpInterpreter.h"| if (CXXRD->getNumBases() <= ibase) | ||
| return nullptr; | ||
| if (!CXXRD || CXXRD->getNumBases() <= ibase) | ||
| return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| return 0; | |
| return nullptr; |
|
|
||
| TCppType_t GetFunctionArgType(TCppFunction_t func, TCppIndex_t iarg) { | ||
| auto* D = static_cast<clang::Decl*>(func); | ||
| auto* D = (clang::Decl*)func; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
auto* D = (clang::Decl*)func;
^| auto* Within = llvm::dyn_cast<DeclContext>(D); | ||
| LOCK(getInterpInfo(D)); | ||
| bool ExistsFunctionTemplate(const std::string& name, TCppScope_t parent) { | ||
| DeclContext* Within = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| DeclContext* Within = 0; | |
| DeclContext* Within = nullptr; |
| bool ExistsFunctionTemplate(const std::string& name, TCppScope_t parent) { | ||
| DeclContext* Within = 0; | ||
| if (parent) { | ||
| auto* D = (Decl*)parent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
auto* D = (Decl*)parent;
^| static TCppFuncAddr_t GetFunctionAddress(const FunctionDecl* FD) { | ||
| const auto get_mangled_name = [](const FunctionDecl* FD) { | ||
| auto* MangleCtxt = getASTContext(FD).createMangleContext(); | ||
| auto MangleCtxt = getASTContext().createMangleContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto MangleCtxt' can be declared as 'auto *MangleCtxt' [llvm-qualified-auto]
| auto MangleCtxt = getASTContext().createMangleContext(); | |
| auto *MangleCtxt = getASTContext().createMangleContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Having a TakeInterpreter interface outside of threading is useful I think.
1f43b4e
into
compiler-research:main
To be merged later, after fixing stuff and performance.