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 allows to find an existing function template instance even based on only
the template name (of course, in this case, no instantiation is done, only already
existing ones can be returned).
This allows add there same features to TListOfFunctions::FindObject and
TViewAllPublicFunctions::FindObject.
TClassEdit::ResolveTypedef was not properly handling the leading const
if there is a namespace in the name (and no template).
Transform::GetPartiallyDesugaredType was not keeping the 'const' in case
the target of the typedef was in the global scope (for example being a
fundamental type).
This fixes ROOT-5576
As the other findFunction*, findAnyFunction does not
(yet?) instantiate the function template if has not
yet been instantiated.
Also add test for findAnyFunction.
For example:
namespace edm {
template <int I> class Hash {};
const int typeN =1;
typedef Hash<typeN> ParentageID;
}
edm::ParentageID should be desugared to edm::Hash<1>.
When the machine code was generated the JIT retains a lock to the global values
so they don't go out of sync. In the cases of circular references like:
int g();
int f() {g();}
int g() {f();}
we cannot count on the removal order to get rid of the uses. We need to use the
replaceAllUsesWith. This is however tricky because the JIT already generated the
code for f and g and it doesn't make sense to replace anything with anything else.
Thus in order to support that we need to hack one of the JIT callbacks which
prevents the replace of values of already emitted code.
The compiled code is unloaded by iterating the AST out of which the compiled code
came. The problem is that C++ supports static initialization. For example:
int a = 5; on the global scope means set the value of a to 5 before the program
starts. To support that clang implicitly generates functions that enforce the
expected initialization order. That can become easily very complex. Let's see
a more "real-life" example:
int f() { printf("I am f()"); return 0; }
int a = f();
Besides the code for a and f clang will emit:
define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
%0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"struct.cling::runtime::internal::__trigger__cxa_atexit"*)* @_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev to void (i8*)*), i8* getelementptr inbounds (%"struct.cling::runtime::internal::__trigger__cxa_atexit"* @_ZN5cling7runtime8internal1SE, i32 0, i32 0), i8* @__dso_handle) #1
ret void
}
define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
call void @__cxx_global_var_init()
ret void
}
and more importantly:
define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
%call = call i32 @_Z1fv() ; THAT IS A REFERENCE TO f()
store i32 %call, i32* undef, align 4
ret void
}
So when iterating the AST and trying to remove f(), we cannot because it is still
referenced by __cxx_global_var_init1. However we know this is not an issue,
because that __cxx_global_var_init1 was meant to be executed only once and that
already happened. So in first approximation we could drop the references of f
in __cxx_global_var_init1 and remove the rest.
When we dectect that the last expression is a record type and is not
a temporary, we now return it by reference, hence avoiding an unnecessary
and sometimes impossible (cout) copy. If it is a temporary we still
return a 'copy'.
GetPartiallyDesugaredType was 'forgetting' to add full qualification of the
template parameters in some case (where the template paramter in the
QualType was not yet an elaborated type). Extend the internal interface to
distinguish when we need to add full qualification to the type itself or its
template parameters.
Add new overload for findFunctionProto and matchFunctionProto which rather than
taking the list of argument types as a StringRef, take it as a
const llvm::SmallVector<clang::QualType, 4>. This avoids the (permanent)
allocations inside clang due to the Parsing of types.
The new call is:
const clang::FunctionDecl* matchFunctionProto(const clang::Decl* scopeDecl,
llvm::StringRef funcName,
llvm::StringRef funcProto,
bool objectIsConst
) const;
and the function must match in name and prototype (including constness).
The only thing not checked is the actual declaration context.
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
This cause the number of unique wrappers to decrease by 1.
Fix the test correspondingly.
git-svn-id: http://root.cern.ch/svn/root/trunk@48854 27541ba8-7e3a-0410-8455-c3a389f83636
For example, when we have enum e {e1=1}; and we do e1 on the prompt we got the
address of e1 and we printed it out. However, this doesn't make sence because we
cannot use it later, because it is destroyed.
git-svn-id: http://root.cern.ch/svn/root/trunk@48850 27541ba8-7e3a-0410-8455-c3a389f83636
Add a tests for that.
Fix involuntary test (using an undeclared printf) by fwd declaring printf.
git-svn-id: http://root.cern.ch/svn/root/trunk@48787 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
type is trivially copiable and cling::StoredValueRef is not.
We could check for a copy ctor (which is defined in that type), however, that is
not important at the moment. We can readd that logic on use-case.
git-svn-id: http://root.cern.ch/svn/root/trunk@47825 27541ba8-7e3a-0410-8455-c3a389f83636
Switch BeginSourceFile() on after having parsed Interpreter internals.
Switch it off (EndSourceFile()) in ~Interpreter.
Indentation.
Now that we handle diags appropriately, test/ErrorRecovery/MetaProcessor.C fails; repair it.
git-svn-id: http://root.cern.ch/svn/root/trunk@47476 27541ba8-7e3a-0410-8455-c3a389f83636
Thus also no need anymore to collect all jitted functions through a function JIT listener.
Sadly, recompilation of them will pick up the existing stub instead of actually recompiling.
Don't use StringRef.data() where we need a 0-terminated string for FindFunctionNamed().
Be explicit about what symbol is triggering an unresolved symbol.
Update test suite.
git-svn-id: http://root.cern.ch/svn/root/trunk@47398 27541ba8-7e3a-0410-8455-c3a389f83636
Accept that Value's type is not the last Expr's type (e.g. const char[5]) but whatever the wrapper returns, (e.g. const char*).
Print StoredValueRefs recursively.
Add mechanism to suppress newlines (improves readability for nested calls)
git-svn-id: http://root.cern.ch/svn/root/trunk@47169 27541ba8-7e3a-0410-8455-c3a389f83636
Right now the issue is not that urgent. We will have to revisit and rethink the
test case.
git-svn-id: http://root.cern.ch/svn/root/trunk@46859 27541ba8-7e3a-0410-8455-c3a389f83636
declarations - it just compiles and runs given expression or statement.
git-svn-id: http://root.cern.ch/svn/root/trunk@46636 27541ba8-7e3a-0410-8455-c3a389f83636
Check that redecl causes an error -- only the whole verify thing doesn't actually verify!
Also, the initializer should end up in the Value returned by evaluate; it's not!
git-svn-id: http://root.cern.ch/svn/root/trunk@46626 27541ba8-7e3a-0410-8455-c3a389f83636
seconds, but I don't like where EvaluateInternal is going.
At first place it shouldn't do any smart guessing what the transformers would do.
Second it shouldn't try to attach expression evaluation (storing the result in
cling::Value) while preparing for value printing.
To sum up:
* Simplify the old craft in EvaluateInternal
- Move the value printing logic into the value printer transformer.
- Move the expression evaluation login (mainly coming through the
Interpreter::evaluate interface) into separate transformer.
* Attach the new transformer to the list of transformers (the size of it was
increased as well.)
* Add new compilation option switch that the new transformer will react on.
* Turn on the switch where necessary.
* Simplify value printer logic. Now everything is at one place, which makes it
simpler and easier to debug.
* Make IncrementalParser::Parse to take compilation options' reference instead of
constructing it's own.
* As consequence of the new implementation - two bugs in the testsuite were
uncovered. Propose a fix for them.
* Improve documentation.
* TODO: There is some code duplication, which will be factored out soon.
git-svn-id: http://root.cern.ch/svn/root/trunk@46549 27541ba8-7e3a-0410-8455-c3a389f83636