Commit Graph

562 Commits

Author SHA1 Message Date
Philippe Canal
ea36f5aa5d Attempt to fix the test on 32 bits platforms
git-svn-id: http://root.cern.ch/svn/root/trunk@48801 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-02 02:38:59 +00:00
Philippe Canal
5b7940b35d add more test with qualifications
git-svn-id: http://root.cern.ch/svn/root/trunk@48795 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 19:05:54 +00:00
Philippe Canal
90685e1db3 remove more llvm::
git-svn-id: http://root.cern.ch/svn/root/trunk@48794 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 18:12:48 +00:00
Philippe Canal
60ae47802f remove all clang::
git-svn-id: http://root.cern.ch/svn/root/trunk@48793 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 18:06:58 +00:00
Philippe Canal
8d3732c699 In GetPartiallyDesugaredType, properly handle the case where the typedef and its target are in different scope
and the case where the typedef (or the type) has a partially qualified name (we need to complete it) and 
double check that we do not have :: in front.

This fixes the result when scanning through:

class Embedded_objects {
public:
  typedef std::vector<int> vecint;
  vecint::iterator m_iter;
  typedef vector<int> vecint2;
  vecint2::iterator m_iter2;
};

namespace NS1 {
  namespace NS2 {
    namespace NS3 {
      class Point {};
      class Inner3 {
      public:
        Point p1;
        NS3::Point p2;
        ::NS1::NS2::NS3::Point p3;
      };
    }
  }
}

Also remove some llvm:: and clang::


git-svn-id: http://root.cern.ch/svn/root/trunk@48792 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 17:59:59 +00:00
Vassil Vassilev
58691c3e5d Update CMake
git-svn-id: http://root.cern.ch/svn/root/trunk@48790 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 16:22:32 +00:00
Vassil Vassilev
4ddfceeed4 Implement the full support of inlines and modules. The issue is when we load a
library we have to generate code for all the inlines functions.

These days I have hard time with the "[early] return statements" (due to the 
lack of sleep). Thanks Axel for noticing the issue.


git-svn-id: http://root.cern.ch/svn/root/trunk@48789 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 16:06:58 +00:00
Vassil Vassilev
7194fff3a6 Improve the code generation of inlines. The recursive AST visitor visits nested
inlines and calls codegen on it.
  There are still implementation flaws (eg. std::pow(...)), that we are still 
debugging.


git-svn-id: http://root.cern.ch/svn/root/trunk@48788 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 15:15:31 +00:00
Axel Naumann
451a0e5066 Dynamic lookup: replacing something in the condition doesn't mean that we should give up; there might be more to replace in the then / else parts.
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
2013-03-01 15:13:01 +00:00
Axel Naumann
756aceef51 Mke the copy more noisy to debug dependency problem in full builds.
git-svn-id: http://root.cern.ch/svn/root/trunk@48785 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 14:13:04 +00:00
Philippe Canal
6f8d8f8d71 Missed a spot in r48782
git-svn-id: http://root.cern.ch/svn/root/trunk@48784 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 12:29:22 +00:00
Philippe Canal
214fc4f963 We now are stripping the elaborated type so, no more :: prefix
git-svn-id: http://root.cern.ch/svn/root/trunk@48782 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 11:28:35 +00:00
Philippe Canal
83db486387 When looking at the whether the target is in std, let's look at the final target (rather than just one hop). Desugar Elaborated type (inside the type chain).
git-svn-id: http://root.cern.ch/svn/root/trunk@48778 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 01:33:38 +00:00
Vassil Vassilev
c44b59bab7 Follow the lowStartingCaps.
git-svn-id: http://root.cern.ch/svn/root/trunk@48764 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-28 10:55:45 +00:00
Vassil Vassilev
12a6b029e3 Typo.
git-svn-id: http://root.cern.ch/svn/root/trunk@48762 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-28 10:03:29 +00:00
Vassil Vassilev
ee2372ae3f Implement support of implicit (C++11) auto keyword.
Now we support name = initializer; style syntax, which gets transformed semantically
into auto name = initializer; Eg. i = 45;
The underlying mechanics are similar to the dynamic scopes. We "heal" the failed
lookup of "name" and then transform the created by Sema binary operator into a 
declaration statement after making the type deduction.

Note that the code in the TClingCallbacks could and will be extracted in cling's
codebase.


git-svn-id: http://root.cern.ch/svn/root/trunk@48736 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-27 15:28:38 +00:00
Axel Naumann
96b10954c4 Don't crash when emitting diagnostics during startup, but set up diag client before doing the runtime includes.
git-svn-id: http://root.cern.ch/svn/root/trunk@48732 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-27 15:05:21 +00:00
Axel Naumann
8258396916 Add missing headers, included by cling::Interpreter c'tor.
Fixes crash on optimized builds.


git-svn-id: http://root.cern.ch/svn/root/trunk@48731 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-27 15:04:39 +00:00
Axel Naumann
94a345f528 Modules can be enabled through flags into Interpreter()
git-svn-id: http://root.cern.ch/svn/root/trunk@48716 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-26 14:41:08 +00:00
Axel Naumann
1acbc2d486 GenericValue::op= is smart; it takes *this into account.
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
2013-02-26 11:14:05 +00:00
Axel Naumann
46bd172859 Add proper include guard.
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
2013-02-26 09:46:50 +00:00
Vassil Vassilev
a343830c5b Create and initialize the type source info. Avoids crashes in the AST build by
the dynamic scopes.


git-svn-id: http://root.cern.ch/svn/root/trunk@48701 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 17:09:57 +00:00
Axel Naumann
38fd2bc3c5 Copy headers only after llvm has been built, i.e. don't make ALLHDRS depend on it.
Remove unused rule.


git-svn-id: http://root.cern.ch/svn/root/trunk@48697 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 16:25:39 +00:00
Axel Naumann
eae6e6b760 Update the *massively* reduced list of headers we need for runtime.
git-svn-id: http://root.cern.ch/svn/root/trunk@48692 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 16:00:51 +00:00
Axel Naumann
b364112d1d Don't expose SmallVector (which needs DataTypes.h).
Use vector instead.


git-svn-id: http://root.cern.ch/svn/root/trunk@48691 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 15:54:36 +00:00
Axel Naumann
5279835d41 Add explicit copy c'tor + assign op so no uninit memory gets copied.
git-svn-id: http://root.cern.ch/svn/root/trunk@48689 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 15:20:49 +00:00
Axel Naumann
9d69f41211 Move llvm::sys::DynamicLibrary out of the Interpreter header.
git-svn-id: http://root.cern.ch/svn/root/trunk@48685 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 13:38:54 +00:00
Axel Naumann
87356648fb Indentation, use using directive.
git-svn-id: http://root.cern.ch/svn/root/trunk@48684 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 13:15:35 +00:00
Axel Naumann
c835d37455 Don't store Paths but strings. Reduces dependencies.
git-svn-id: http://root.cern.ch/svn/root/trunk@48683 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 13:14:24 +00:00
Vassil Vassilev
edcc7a51fa Reduce fwd decls.
git-svn-id: http://root.cern.ch/svn/root/trunk@48680 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 10:19:15 +00:00
Axel Naumann
2ac4022b04 Add missing file.
git-svn-id: http://root.cern.ch/svn/root/trunk@48679 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 07:51:21 +00:00
Axel Naumann
e5a34d0f47 Add new file.
git-svn-id: http://root.cern.ch/svn/root/trunk@48678 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 07:47:39 +00:00
Axel Naumann
40ef9800f6 Try to load the header from a module, if that fails: include the header.
Fixes cling test suite.


git-svn-id: http://root.cern.ch/svn/root/trunk@48676 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-22 16:35:15 +00:00
Axel Naumann
664e8b22ac Reduce the amount of headers needed by the dynamic scopes at runtime:
* 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
2013-02-22 15:59:54 +00:00
Axel Naumann
e0397a6d4c Be specific about which gCling we are talking about (ROOT has its own...)
git-svn-id: http://root.cern.ch/svn/root/trunk@48667 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-21 17:34:59 +00:00
Axel Naumann
fd45ec84c1 Don't create a variable of type __trigger__cxa_atexit; that's only needed for the header to convince the JIT to codegen its d'tor (it will create dupe symbols when compiling the dictionary otherwise).
Use loadModuleForHeader() for DynamicLookupRuntimeUniverse.h - we need to find a way to determine whether CodeGen needs to run on an include (i.e. whether it's from a PCM) or not.


git-svn-id: http://root.cern.ch/svn/root/trunk@48665 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-21 17:31:30 +00:00
Axel Naumann
711f95413f Fix rules for etc/cling/Interpreter and friends.
git-svn-id: http://root.cern.ch/svn/root/trunk@48664 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-21 17:28:27 +00:00
Vassil Vassilev
d0af24b957 From Axel and me: As a mid-term solution copy some LLVM and clang header files
in ROOT's etc/cling.


git-svn-id: http://root.cern.ch/svn/root/trunk@48641 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-19 14:14:07 +00:00
Vassil Vassilev
58b3a268a6 Enhance the LookupHelper's findScope to return decls for non enum types.
git-svn-id: http://root.cern.ch/svn/root/trunk@48639 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-19 09:30:00 +00:00
Vassil Vassilev
8e45223665 Remove accidentally checked in ;
git-svn-id: http://root.cern.ch/svn/root/trunk@48638 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-19 09:28:40 +00:00
Vassil Vassilev
3f1ede3564 Remove accidentally checked in code.
git-svn-id: http://root.cern.ch/svn/root/trunk@48637 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-19 09:26:54 +00:00
Vassil Vassilev
649f9c47d4 Improve style
git-svn-id: http://root.cern.ch/svn/root/trunk@48635 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-19 09:25:04 +00:00
Vassil Vassilev
a526b217e0 Explicit template instantiations should end up on the global scope.
Fixes: http://savannah.cern.ch/bugs/?100449


git-svn-id: http://root.cern.ch/svn/root/trunk@48618 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-18 13:22:39 +00:00
Philippe Canal
e5d5914ccb Add missing null pointer protection
git-svn-id: http://root.cern.ch/svn/root/trunk@48595 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-15 12:42:09 +00:00
Philippe Canal
e869ee0993 Add testing of the desugaring behavior of typdef inside std
git-svn-id: http://root.cern.ch/svn/root/trunk@48577 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 17:45:49 +00:00
Vassil Vassilev
3bcfc8b25e Prepare dynamic scopes for integration in ROOT;
* 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
2013-02-14 17:29:30 +00:00
Philippe Canal
4c4a43770d Switch from not desugaring *all* typedef that are declared within a class or namespace inside std to not desugaring the typedef that are declared in std and are pointing to a class, enum or struct that is declared in std or __gnu_cxx (or a class or namespace nested within those namespaces).
This revises the behavior introduced in revision 46131.
This fixes <https://savannah.cern.ch/bugs/?100390>

Philippe.


git-svn-id: http://root.cern.ch/svn/root/trunk@48574 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 17:23:47 +00:00
Philippe Canal
578fbe2a93 Disable the warning about uninitialized field when parsing a header from a module ... this avoid complaining about a (real) bug in QT headers
git-svn-id: http://root.cern.ch/svn/root/trunk@48572 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 17:10:38 +00:00
Vassil Vassilev
ca634731e2 Tabs.
git-svn-id: http://root.cern.ch/svn/root/trunk@48569 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 11:36:41 +00:00
Philippe Canal
a7f6d5c3c9 Finish 48510 SubstTemplateTypeParmType can indeed carry meaningfull qualifier (also add related test)
git-svn-id: http://root.cern.ch/svn/root/trunk@48549 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-12 18:38:58 +00:00