IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This is the case for example with gcc's
__gnu_cxx::__common_pool_policy<__gnu_cxx::__pool,true>
where __pool is actually a class template.
Also reduce (a little bit) code duplication.
The only real current user - ROOT - cannot make use of the diagnostics.
Instead the default callback should probably only be invoked if none of
the other, multiplexed handlers returns true.
With the unique_ptr, we were crash due to the held over reference described
below. Trying to move the m_ExternalSemaSource deletion after the m_IncrParser
deletion also leads to crash due to the double deletion (once by the ASTContext,
once by m_ExternalSemaSource) of the ExternalSemaSource.
If m_Callbacks is declared after m_IncrParser, it will be deleted first
and if m_ExternalSemaSource is a unique_ptr, it willbe deleted before
m_IncrParser is delete.
During the Incremental parser deletion, there is a call to
CodeGenModule::Release, then EmitTargetMetdata is called and it tries to
get the most recent decl which calls
clang::LazyGenerationalUpdatePtr<...>::get
which has a LazyVal which has a cached pointer to the AST external
source. So this placement is necessary to solve a tear down crash.
#0 clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428
428 (LazyVal->ExternalSource->*Update)(O);
(gdb) l
423 /// Get the value of this pointer, updating its owner if necessary.
424 T get(Owner O) {
425 if (LazyData *LazyVal = Value.template dyn_cast<LazyData*>()) {
426 if (LazyVal->LastGeneration != LazyVal->ExternalSource->getGeneration()) {
427 LazyVal->LastGeneration = LazyVal->ExternalSource->getGeneration();
428 (LazyVal->ExternalSource->*Update)(O);
429 }
430 return LazyVal->LastValue;
431 }
432 return Value.template get<T>();
#0 clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428
#1 0x000000010005ce38 in clang::Redeclarable<clang::FunctionDecl>::DeclLink::getNext (this=0x1069c3ff0, D=0x1069c3f90) at Redeclarable.h:74
#2 0x000000010005cd81 in clang::Redeclarable<clang::FunctionDecl>::getNextRedeclaration (this=0x1069c3ff0) at Redeclarable.h:119
#3 0x000000010005d0b3 in clang::Redeclarable<clang::FunctionDecl>::getMostRecentDecl (this=0x1069c3ff0) at Redeclarable.h:161
#4 0x000000010137bfdc in clang::FunctionDecl::getMostRecentDeclImpl (this=0x1069c3f90) at Decl.h:1568
#5 0x00000001004b5346 in clang::Decl::getMostRecentDecl (this=0x1069c3f90) at DeclBase.h:806
#6 0x0000000100897128 in clang::CodeGen::CodeGenModule::EmitTargetMetadata (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3271
#7 0x0000000100895237 in clang::CodeGen::CodeGenModule::Release (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:395
#8 0x0000000100981b3c in clang::CodeGeneratorImpl::ReleaseModule (this=0x106506d70) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/ModuleBuilder.cpp:82
#9 0x00000001001c3f88 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:168
#10 0x00000001001c3f25 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:166
#11 0x00000001001d8905 in std::__1::default_delete<cling::IncrementalParser>::operator() () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2426
#12 0x00000001001d8905 in ~unique_ptr [inlined] () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2625
#13 0x00000001001d8905 in ~Interpreter (this=0x7fff5fbff020) at memory:2593
#14 0x00000001001d8355 in ~Interpreter (this=0x7fff5fbff020) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/Interpreter.cpp:229
#15 0x00000001002b0318 in main (argc=1, argv=0x7fff5fbff740) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/tools/driver/cling.cpp:97
This callback works in sync with the forward declaration autoloading maps. I.e
we produce a forward declaration map file. However for certain forward declarations
we need for example to put the default arguments. For instance function declarations
need default arguments, and it would be sufficient to make a library call.
However the problem is when the actual definitions come and try to merge with
the forward declarations. In the function decls case, the compiler naturally will
issue an error because C++ doesn't allow two declarations to define the default
arguments. The same holds for template classes (of course following a lot more
complex semantics). This callback monitors if a file with the original file
(whose forward decls were registered) is being #included and strips all the
default arguments so that the following pattern is compilable: