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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Parser::Scope versus Sema::DeclContext are now checked for cross-vailidity.
Emit the TU-transaction explicitly instead of relying on a first transaction.
The typename extraction now takes a stream instead of a string to write to.
The llvm::Linker has much reduced functionality; use llvm::sys::Path instead to find dynamic libraries.
git-svn-id: http://root.cern.ch/svn/root/trunk@49325 27541ba8-7e3a-0410-8455-c3a389f83636
the callbacks must be triggered for those, too.
As they are not part of a transaction (think "module") they are now sent to the deserialization listener.
This can be removed once the modules work.
Set the state of the transaction to Committing before the static init - which might trigger more decls even though CodeGen has been run over the decls.
Forward DeclCollector::HandleInterestingDecl() to DeclCollector::HandleTopLevelDecl() for decls from the AST reader / from headers describing libraries.
Empty transactions must be passed to TCling; they trigger the sending of deserialized decls to ROOT/Meta.
Don't start TCling's artificial TU Transaction if the transaction coming in is empty - we need a decl to get the ASTContext.
Swap the deserialized decls before handling them in TCling, such that nested calls don't see the same decls again.
git-svn-id: http://root.cern.ch/svn/root/trunk@49197 27541ba8-7e3a-0410-8455-c3a389f83636
Add comparison ops: I needed them for a dead end and now I have them and the compiler won't generate its own.
git-svn-id: http://root.cern.ch/svn/root/trunk@49101 27541ba8-7e3a-0410-8455-c3a389f83636
Rephrase !(a==b).
This file still needs major refactoring to remove code duplication.
git-svn-id: http://root.cern.ch/svn/root/trunk@49099 27541ba8-7e3a-0410-8455-c3a389f83636
collecting->completed->committing->committed
Make m_DeclQueue lazily allocated to reduce sizeof(Transaction) in an effort to make the TransactionRAII cheaper - second part is coming up.
Remove unused thus unneeded and annoying (non-const) iterator interfaces; they clash with the constness of the EmptyQueue.
git-svn-id: http://root.cern.ch/svn/root/trunk@49097 27541ba8-7e3a-0410-8455-c3a389f83636
The issue is that sometimes we don't have a begun transaction. This can happen
mostly in cases when the code doesn't come from text representation but:
* From lookup, where template is being instantiated
* From a PCH/PCM, where a decl was deserialized.
This patch solves the first case: When we do findScope we have to instantiate
the declaration if needed.
Every time there is a chance that generated code's declarations can be orphaned,
we have to explicitly push a transaction so that we can keep the integrity.
git-svn-id: http://root.cern.ch/svn/root/trunk@49070 27541ba8-7e3a-0410-8455-c3a389f83636
Some functions return temporary objects. Eg:
std::string getName() {
return "ROOT";
}
In that case the lifetime of the temporary variable is defined by the caller.
Such function called by TClingCallFunc would cause undefined behaviour, because
there is no actual caller and the compiler cannot define any lifetime.
In order to provide such concept we have implemented cling::StoredValueRef, which
is a reference counted cling::Value. As long as somebody "has" a copy of it, the
boxed value (and the occupied memory) will live.
However cling::Value and cling::StoredValueRef expose LLVM/clang/cling internals
to ROOT. We want to avoid for now exposing LLVM/clang/cling internals, so we have
TInterpreterValue, which makes cling::StoredValueRef opaque.
*New interface taking TInterpreterValue is added to the TInterpreter to allow the
users to manage the lifetime of the returned temporaries.
*Replace the occurrances of cling::Value with cling::StoredValueRef to avoid
any lifetime management issues.
*Minor optimizations of the existing implementation
*Tweaks to the build system so that TInterpreterValue.cxx could
#include cling/Interpreter/StoredValueRef.h
PLEASE NOTE: This is not the final implementation it needs polishing. Eg. there
is a bug that should be fixed soon, which doesn't allow to get the actual result
out of the TInterpreterValue.
git-svn-id: http://root.cern.ch/svn/root/trunk@48895 27541ba8-7e3a-0410-8455-c3a389f83636
Remaining:
* callfunc issues finding functions
* vtable issues (likely related)
* in stressHistogram: Test 3: Projection with Range for Histograms and Profiles................OK
Error in <TStreamerInfo::Build>: TProfile, unknown type: EErrorType fErrorMode
git-svn-id: http://root.cern.ch/svn/root/branches/dev/root6-pch@48858 27541ba8-7e3a-0410-8455-c3a389f83636
Reshuffle gCling; definition is now provided by the Interpreter internally, not in any header.
This will cause missing symbols in libraries instead of silently creating dumplicated (JIT / library).
Still requires Vassil to add a parameter to LifetimeHandler() - but this will cause a cling test failure as a reminder.
git-svn-id: http://root.cern.ch/svn/root/trunk@48817 27541ba8-7e3a-0410-8455-c3a389f83636
That won't work for construction; so replace with placement new.
Also need default c'tor for Value() to initialize m_GV correctly.
git-svn-id: http://root.cern.ch/svn/root/trunk@48709 27541ba8-7e3a-0410-8455-c3a389f83636
This header gets included by enabling dynamic lookup, and by RegisterModule() of G__Meta.
We need the latter for the many-pcm case.
git-svn-id: http://root.cern.ch/svn/root/trunk@48703 27541ba8-7e3a-0410-8455-c3a389f83636
* Make GenericValue, clang::QualType opaque in Value
* Move LifetimeHandler implementation into source; requires separate header
*
Also:
* Value: replace CPP macros by overloads
git-svn-id: http://root.cern.ch/svn/root/trunk@48675 27541ba8-7e3a-0410-8455-c3a389f83636
* Merge the DynamicIDHandler into InterpreterCallbacks. The DynamicIDHandler was
used to define the failed lookup names as dependent, so that later on they could
be "healed" by the EvaluateTSynthesizer - by generating a call to gCling->EvaluateT...
* Add a flag in the InterpreterCallbacks giving a hint when the failed lookup is
performed - during compilation time or during evaluation type, maybe its name is
misnomer. Maybe I should rename it to IsInRuntimeEvalMode or smth like that...
* Simplify the evaluation routine. The idea is to be merged with one of the
existing - either echo or evaluate
* Implement proper mock object as test dynamic symbol resolver callback. Now it
fully relies on InterpreterCallbacks.
* Implement dynamic expression node marking. Every node that needs runtime
resolution is marked as dependent. However, clang marks other nodes as dependent,
too (eg. templates). Until now it was very difficult to distinguish between both.
Now every "artificially" (marked by us) node's declaration is annotated so that
it could be found back easily by using a simple RecursiveASTVisitor.
Generally we have two issues when using dynamic scopes - filtering the failed
lookups that need to be evaluated at runtime, and filtering the "artificially"
marked as dependent dynamic nodes/decls. Whereas the second issue is solved by
using the annotations, the first one is more tricky to solve because clang doesn't
give us enough information to conclude what should be done. For now I have
narrowed down the cases so that dynamic nodes can appear only in function decls.
git-svn-id: http://root.cern.ch/svn/root/trunk@48575 27541ba8-7e3a-0410-8455-c3a389f83636
to maybeMangleDeclName (which is more talkative).
Use Interpreter::maybeMangleDeclName instead of duplicating code.
git-svn-id: http://root.cern.ch/svn/root/trunk@48545 27541ba8-7e3a-0410-8455-c3a389f83636
CallFunc representation of a member function, we have its concrete address, and
if there is derived class there is no way how to evaluate the vtable and call the
correct virtual.
In order to evaluate the member's vtable, we either have to calculate it (which
is platform/implementation dependent) or create a trampoline function which calls
the target function. Thus codegen will generate code for vtable evaluation. The
trampolines are created for functions that could be possibly virtual - non-static
member functions, declared as virutal. A trampoline looks like this:
void unique_name(Base* This, MyClass2* a, MyClass3* b, double c, MyClass* ret) {
if (ret)
*ret = This->function(*a, *b, c);
else
This->function(*a, *b, c);
}
where we pass in explicitly the address that CallFunc is given (This), followed
by set of arguments (possibly needing conversion) and if the target is non-void
a last argument that is used to provide a storage for the return result.
The given arguments and the required by *LLVM* IR may differ - in that case
simple argument conversions are done. For now primary pointers and builtins, which
covers pretty much entire LLVM type system.
Note that the first implementation is very rough and suboptimal, however it is
very good starting point (milestone):
* Common code is extracted out in its separate routines (here a lot of refactoring more
could be done).
* cling::Value now stores besides clang::QualType, describing (soft-of inaccurately)
the llvm::GenericValue, LLVM-type which is the actual description of the generic value.
* cling::Value naming conventions improved;
* cling::Interpreter::getLLVMType is added temporarily and soon will be removed.
* TClingCallFunc now preallocates space for the this ptr and the return result.
(instead of multiple array copies)
* TClingCallFunc now stores not llvm::GenericValues but cling::StoredValueRefs
because the type conversions need llvm::GenericValue's description (which
essentially is the type).
* Does better default argument evaluation: it could be even *more betterer* if
we query Sema to fold for us the constant expressions instead of decompiling them
to source and using cling for evaluation.
* Return storage implemented.
And, yes that is the longest commit message in my life...
Implementation of argument conversion is revised.
git-svn-id: http://root.cern.ch/svn/root/trunk@48537 27541ba8-7e3a-0410-8455-c3a389f83636
* Add the dynamic ID handler, responsible for the dynamic scopes, as ExternalSemaSoruce
for the TClingCallbacks.
From here on we don't know how many tests will fail due to that.
I might end up reverting it if they are too many.
git-svn-id: http://root.cern.ch/svn/root/trunk@48529 27541ba8-7e3a-0410-8455-c3a389f83636
The issue we experienced is that we couldn't pipe the output in the terminal.
The reason is that we were using llvm::outs() which closes explicitly the file
descriptor (thanks Axel for the help debugging).
We introduce our custom stream, which keeps the file descriptor open so that
we can use it in pipes. For debugging purposes, however we use/should use llvm::errs()
The lesson learned:
DONT USE LLVM::OUTS() ANYMORE!
git-svn-id: http://root.cern.ch/svn/root/trunk@48316 27541ba8-7e3a-0410-8455-c3a389f83636