Commit Graph

77 Commits

Author SHA1 Message Date
Bertrand Bellenot
bf14b93185 Suppress MSVC warning C4530: C++ exception handler used, but unwind semantics are not enabled 2014-02-21 10:52:58 +01:00
Vassil Vassilev
bf57dc0424 Move isOnScopeChains to a common ground. Erase the decl from the resolver chain only if it existed there. 2014-02-12 15:30:59 +01:00
Philippe Canal
c6501ffe97 Introduce Transform::Config::DropDefaultArg
Currently only implemented for the STL collection.

This could eventually be used to allow customization
of which default argument to strip and which class template.

For now, it is only used to prevent the addition of template
default template argument to the STL collection ... which
we would any strip.

This fixes the secondary issue in ROOT-6020 (one class template
instance having more than one corresponding TClass due to the
inconsistency in the normalization (not adding vs not stripping)
2014-02-01 03:18:02 +01:00
Philippe Canal
1004034c75 Move IsStdClass to cling::utils::Analyze 2014-02-01 03:18:02 +01:00
Philippe Canal
0208d472dd Check that we found '::std' rather than some other namepace named std 2014-01-20 16:33:12 +01:00
Philippe Canal
8b1fd832dc Strip inline namespace 2014-01-20 16:33:11 +01:00
Axel Naumann
0236fc8c04 Make sure the prefix is a class (ROOT-5856). 2014-01-20 14:42:58 +01:00
Axel Naumann
8aedeca69c Refer to license in CMake files. 2014-01-07 12:02:58 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Axel Naumann
5da6e646a5 Correct licenses in Makefiles. 2014-01-07 11:13:56 +01:00
Axel Naumann
c73e6eb493 Re-implement (explicitly) handling of typedefs as nested name specs: TD::A.
This got lost in 2b6ae0aed / 96a4437c8 where typedefs were handled.
Simplify logic (and thus shorten code).
Fixes error in roottest/root/tree/addresses:
Error in <TStreamerInfo::Build>: Embedded_objects, unknown type: EmbeddedTypedef::Embedded3 m_emb4
2014-01-06 18:27:00 +01:00
Axel Naumann
4d98a76dec Support FullyQualName for ::B, fixes roottest/cling/op/ConversionOp. 2013-12-21 15:11:50 +01:00
Axel Naumann
0f3b2ba7f9 Remove now unused function. 2013-12-20 16:50:52 +01:00
Axel Naumann
db0fb9d2c4 Fatally misspelled function name: not type but namespace (ROOT-5867). 2013-12-20 15:22:49 +01:00
Philippe Canal
6850b1db86 Add IsStdOrCompilerDetails 2013-12-17 15:58:55 +01:00
Philippe Canal
3216896e6e Declare local function static (For consistency) 2013-12-17 15:58:54 +01:00
Philippe Canal
453513639f Correct comment (see 5e2960275c7e) 2013-12-17 15:58:54 +01:00
Axel Naumann
7f02f830c9 80col, spaces. 2013-12-05 16:27:01 +01:00
Axel Naumann
0eb9ac042f Make full qualification an option.
Allows GetPartiallyDesugaredType() and GetFullyQualifiedName() to share functionality.
2013-12-04 19:09:59 +01:00
Axel Naumann
97987030f5 Move several TypeName functions from MetaUtils to cling/Utils.
They were once identical but then got bug fixed out of sync.
Moved routines:

GetFullyQualifiedLocalType()
GetFullyQualifiedType()
CreateNestedNameSpecifier()
CreateNestedNameSpecifierForScopeOf()
GetFullyQualifiedTypeNNS()
2013-12-04 19:09:59 +01:00
Axel Naumann
63e094c197 Do not diagnose lookup problems in lookup() interfaces. 2013-12-02 14:21:08 +01:00
Axel Naumann
7106f6546d Protect against Null type. 2013-12-02 13:53:30 +01:00
Philippe Canal
27b213ed73 Properly handled (partial) desugaring of 'const NS::Something_t'
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
2013-11-06 21:39:55 +01:00
Philippe Canal
b96f1409ac In GetPartiallyDesugaredType add support for expression as template parameter.
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>.
2013-10-30 13:44:58 +01:00
Vassil Vassilev
64b1a77356 Fix the case when the decl doesn't need mangling, adapt the test to the new impl. 2013-10-29 20:19:23 +01:00
Vassil Vassilev
eacb364e25 Turn the if into an assert. 2013-10-29 20:19:20 +01:00
Vassil Vassilev
b7de97fa45 Pick up the right ctor/dtor type. 2013-10-29 20:19:20 +01:00
Vassil Vassilev
a97a2811c9 maybeMangleDeclName should take GlobalDecl. This enforces integrity. 2013-10-29 20:19:17 +01:00
Vassil Vassilev
aa5ae69f10 Make the function static. 2013-10-29 20:19:13 +01:00
Vassil Vassilev
96a013d91a Reduce/update patches. 2013-10-20 15:22:03 +02:00
Vassil Vassilev
c35e529cd6 Remove unused code. 2013-09-10 15:41:01 +02:00
Philippe Canal
aa29aa9eb9 Remove dead code (coverity 52208) 2013-09-06 06:25:54 +02:00
Philippe Canal
5572e076ac Do not desugar typedef pointing to compiler 'details'.
Rather than skipping the desugaring of typedef pointing to anything in std, we
skip the desugaring of typedef pointing to a type starting with an underscore.
2013-09-03 13:18:55 +02:00
Philippe Canal
53bf555194 In GetPartiallyDesugaredType add ability to replace a type by a typedef.
Add struct cling::utils::Transform::Config to hold both the list of typedef to
avoid desugaring (m_toSkip) and the list of type to replace by a nicer typedef
(m_toReplace).

This is used to replace basic_string<...> by std::string.
2013-09-03 13:18:55 +02:00
Philippe Canal
3777a7194e Try without 'blocking' desugaring of typedef to std entities 2013-09-03 13:18:55 +02:00
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