Commit Graph

42 Commits

Author SHA1 Message Date
Philippe Canal
52da28145b Fix ROOT-5442, wrong normalization of std::vector<myNamespace::myClass1*>::const_iterator
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.
2013-08-29 08:59:59 +02:00
Paul Russo
63cb406f2f Add support for TClingCallFunc function wrappers to transactions. 2013-08-28 03:46:06 +02:00
Vassil Vassilev
782d2568ea Factor our common functionality and replace CreateTypeSourceInfo with getTrivialTypeSourceInfo.
git-svn-id: http://root.cern.ch/svn/root/trunk@49347 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 12:48:15 +00:00
Vassil Vassilev
cb6210bd0a Fix a valgrind complaint "jump over uninit memory"
It is very weird, clang documentation says:
ASTContext::CreateTypeSourceInfo - Allocate an uninitialized TypeSourceInfo...
ASTContext::getTrivialTypeSourceInfo - Allocate a TypeSourceInfo where all locations...

We should use the getTrivialTypeSourceInfo all over the place...


git-svn-id: http://root.cern.ch/svn/root/trunk@49343 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 12:26:44 +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
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
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
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
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
Philippe Canal
b218b89d4c In the partial desugaring add support for the case where we have a type that point to an already completely desugared template instantiation in which case the type is a RecordDecl rather than a TemplateInstantationType
git-svn-id: http://root.cern.ch/svn/root/trunk@48510 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-07 22:56:10 +00:00
Philippe Canal
101602fb42 Only keep the typedef that are within a class or namespace insidehe std namespace (that way we do desugar std::size_t).
git-svn-id: http://root.cern.ch/svn/root/trunk@48201 27541ba8-7e3a-0410-8455-c3a389f83636
2013-01-04 17:26:48 +00:00
Philippe Canal
d267a7e10e In the GetPartiallyDesugaredType, properly handle the case where the input is partially qualified (input: B::C and the ouput needs to be A::B::C ; i.e. properly handle ElaboratedType as input). Also properly strip the typedef from any of the scopes (A::vecint::iterator -> std::vector<int>::iterator). Add the corresponding test
git-svn-id: http://root.cern.ch/svn/root/trunk@47958 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-11 08:26:00 +00:00
Philippe Canal
33293b1730 Properly handle the qualifiers in the new desugaring code
git-svn-id: http://root.cern.ch/svn/root/trunk@47770 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 20:37:09 +00:00
Philippe Canal
a834428d87 Add a couple of comment on elaboratedType
git-svn-id: http://root.cern.ch/svn/root/trunk@47765 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 18:02:54 +00:00
Paul Russo
b75c068ea4 Make the partial desugaring of types fully granular,
we now explicitly control exactly which types get
desugared and which do not.  The current set which
does get desugared is a first pass at what we need,
I fully expect we will have to tune it as we do
more debugging of roottest.


git-svn-id: http://root.cern.ch/svn/root/trunk@47719 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-29 21:40:44 +00:00
Paul Russo
6f5a94816f Backout revision 47672 because it breaks dictionaries.
git-svn-id: http://root.cern.ch/svn/root/trunk@47680 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 17:18:16 +00:00
Philippe Canal
5d382a09f0 remove un-intentional commit of old code
git-svn-id: http://root.cern.ch/svn/root/trunk@47676 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 16:46:34 +00:00
Paul Russo
6827ff1446 Fix from Philippe to enable Transform::GetPartiallyDesugaredType()
to actually desugar while looking for typedefs to keep.


git-svn-id: http://root.cern.ch/svn/root/trunk@47672 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 16:14:29 +00:00
Vassil Vassilev
0b9ac8557b Factor out the creation on IntegerLiteral in separate public routine.
git-svn-id: http://root.cern.ch/svn/root/trunk@47542 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 17:05:10 +00:00
Philippe Canal
65e877ce0f Properly handle (ignore) outer scope that are not namespace or TagDecl
git-svn-id: http://root.cern.ch/svn/root/trunk@47513 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 23:19:48 +00:00
Axel Naumann
3df2500a81 Be nice to the caller - lookup inside a DeclContext should work even for a const DeclContext, so do a const_cast in the source.
git-svn-id: http://root.cern.ch/svn/root/trunk@47496 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 19:13:06 +00:00
Philippe Canal
fc629a9c46 code convention
git-svn-id: http://root.cern.ch/svn/root/trunk@47391 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 07:36:22 +00:00
Axel Naumann
169edbd5a0 Complain for typedefs inside functions.
git-svn-id: http://root.cern.ch/svn/root/trunk@47204 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 17:49:48 +00:00
Philippe Canal
26e040e03f fix typo
git-svn-id: http://root.cern.ch/svn/root/trunk@47087 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-07 05:31:03 +00:00
Philippe Canal
d1f4b8c39e Add code and testing for classes declared inside an anymous namespace
git-svn-id: http://root.cern.ch/svn/root/trunk@46841 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 19:51:56 +00:00
Vassil Vassilev
50027e07fc std::vector::data() is not standartized and on windows it cause build failure.
GCC implements it but there is a comment saying:
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 464. Suggestion for new member functions in standard containers.
// data access
Use standartized alternative.


git-svn-id: http://root.cern.ch/svn/root/trunk@46710 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-22 12:35:32 +00:00
Vassil Vassilev
acef61e88f Fix not only the address but the string too.
git-svn-id: http://root.cern.ch/svn/root/trunk@46681 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:49:34 +00:00
Philippe Canal
51a176173b Use llvm::isa rathen that QualType::isXYZ as the later reports about the canonical type while we are interested in the direct type. Make sure to recurse if needed after removing the typedefs
git-svn-id: http://root.cern.ch/svn/root/trunk@46675 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:24:46 +00:00
Vassil Vassilev
d916876642 RunFunction takes FunctionDecl as an argument. Thus it avoids a lookup and
simplifies the implementation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46673 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 11:56:52 +00:00
Vassil Vassilev
24cdb599f7 In many modes (eg like evaluate and value print) we need to find the last
expression in the wrapper function and do things with it. In some cases we 
must consider variable declarations as expressions (eg. int i = 5;) and take
the l-value and build a DeclRefExpr and return it.
Extract that common functionality out in a utility function and call it whenever
needed.


git-svn-id: http://root.cern.ch/svn/root/trunk@46668 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 09:22:36 +00:00
Vassil Vassilev
ec129305af Centralize the unique name prefix (the names generated by the interpreter use it)
and provide utility function which checks if a decls has such name.


git-svn-id: http://root.cern.ch/svn/root/trunk@46593 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 08:52:24 +00:00
Vassil Vassilev
ae3a0dfdad * Factor out the duplicate code.
* Avoid alloc/dealloc of the entire body of the function (the CompoundStmt) by
using ugly iterator + offset tricks.


git-svn-id: http://root.cern.ch/svn/root/trunk@46553 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 16:57:53 +00:00
Vassil Vassilev
a67f0ebca8 * Add another overload taking DeclarationName as an argument. This is useful when
we have to deal with failed lookups.
* Improve documentation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46394 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-09 09:41:26 +00:00
Axel Naumann
9e83d653a9 In clang's trunk, asking for the Type of a TemplateArgument is forbidden if it's not a Type.
Indentation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46252 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-28 12:28:14 +00:00
Philippe Canal
c22cd67c6d Fix the handling of B<const Double32_t, const int>
git-svn-id: http://root.cern.ch/svn/root/trunk@46192 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-26 08:01:21 +00:00
Philippe Canal
22952b8f72 Improve the handling of qualified named (i.e. elaborated type) especially when they also have
qualifiers (const std::string) in template arguments.
Fix the handling of default template argument that are not a type.

No longer drop any default argument except for STL collection (as needed by ROOT I/O).

This fixes support of (for example):
#pragma link C++ class std::pair<const std::string,int>+;
#pragma link C++ class ROOT::TArrayProxy<ROOT::TArrayType<double> >+;
 (which is ROOT::TArrayProxy<ROOT::TArrayType<double,0> >)


git-svn-id: http://root.cern.ch/svn/root/trunk@46188 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-25 19:35:24 +00:00
Philippe Canal
f191b6097c fix typo
git-svn-id: http://root.cern.ch/svn/root/trunk@46132 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-22 21:56:36 +00:00
Philippe Canal
fcf8c7fa66 In Transform::GetPartiallyDesugaredType also handle the case where
we are given a qualified typedef (the first node is 'Elaborated' rather
than Typedef), for example ROOT::Math::TDataPoint1D.

Also properly handle the case when the scope of the typedef's underlying
type and the scope of the typedef are different.  In the case their are
the same, keeping the version given as input (after 'normalizing).

Prevent the desugaring of _any_ typedef declared within the std namespace
(for now hardcoded in AST.cpp) to avoid exposing to ROOT implementation
details (this is a kind of replacement for CINT's customized STL header)


git-svn-id: http://root.cern.ch/svn/root/trunk@46131 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-22 21:30:24 +00:00
Philippe Canal
d754a4e262 Do not use standard desugaring if we need to have the full qualification
git-svn-id: http://root.cern.ch/svn/root/trunk@46047 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-19 12:39:06 +00:00
Axel Naumann
05ba8a3a07 Move cling from cint/ to interpreter/ (Will add a "we have moved" readme to cint/cling.)
git-svn-id: http://root.cern.ch/svn/root/trunk@45844 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 09:37:39 +00:00