93 Commits

Author SHA1 Message Date
Frederich Munch
d68ef916ac Use LLVM stream wrappers to reduce complexity and line counts. 2016-12-20 12:29:06 +01:00
Frederich Munch
075f4ffa83 Add cling output streams to cling/Utils/Output.h 2016-12-19 13:59:11 +01:00
Philippe Canal
95c6491b4c In ForwardDeclPrinter records both the top level header and the directly accessible lower level header (when different).
This allows to catch the case where the user generate the dictionary with the top level header (which was the only one recorded before)
and the user #include the lower level header first.
2016-11-18 01:29:09 +01:00
Philippe Canal
f4d9d9ccae Pass Preproc and ASTContext instead of Sema to forward decl printer.
This will allow to lookup files during the printing
2016-11-18 01:29:09 +01:00
Axel Naumann
7a620e3f79 llvm upgrade. 2016-06-15 14:14:33 +02:00
Philippe Canal
5e2fe4b0f0 Fix ROOT-8096
Add proper support for template parameter pack in
cling::ForwardDeclPrinter::VisitTemplateArgument
2016-05-17 14:44:42 +02:00
Philippe Canal
c1cb2ca6f2 Add a means to customize which file are ignored in ForwardDeclPrinter.
This will also rootcling to tell cling's ForwardDeclPrinter to consider the file included inside a LinkDef file as
being top level headers (rather than listing the linkdef itself\!).
2016-02-19 00:00:26 +01:00
Axel Naumann
714df9c374 Revert "Annotate fwd decls with the header containing the decl, not the top-most include."
This reverts commit 125a93e0e3562dac5d5a0429ce49a2b625025c26.
It fails in the following case (roottest/root/io/evolution/pragma_read):
dictionary for a/b.h which includes a/c.h as #include "c.h"
This will add a fwd decl with annotation "c.h", but this header cannot
be found. Instead we'd need "a/c.h"...
2015-06-23 21:30:17 +02:00
Axel Naumann
1718483b7e Unload fwd decls of enums; redeclaring definitions fails. 2015-06-23 11:13:16 +02:00
Axel Naumann
4834289abd Annotate fwd decls with the header containing the decl, not the top-most include. 2015-06-18 16:01:47 +02:00
Axel Naumann
4ebef94da8 Unwrap (implicit) casts for fwd decls (ROOT-7276). 2015-05-18 15:24:09 +02:00
Axel Naumann
4f217d95b3 Veto fwd decl of complex template default argument expressions.
Works around issue with ATLAS forward decl of

namespace Eigen{
  namespace internal{
    template <typename T, int Size, int MatrixOrArrayOptions,
              int Alignment = (MatrixOrArrayOptions & DontAlign) ? 0 : (((Size * sizeof(T)) % 16) == 0) ? 16 : 0>
    struct plain_array;
}}
2015-01-09 16:23:11 +01:00
Danilo Piparo
4dd0bb94ea Add protection in case no file is associated to the decl 2014-12-17 18:35:14 +01:00
Axel Naumann
7f1e4f4383 Protect from skipping function template patterns. 2014-09-26 16:08:06 +02:00
Axel Naumann
35b8c20ce2 For template instances, forward declare its arguments.
Still missing a fwd decl of explicit instantiations!
2014-09-24 12:08:12 +02:00
Axel Naumann
5b5fa04652 Declare outermost namespace first. 2014-09-23 20:56:08 +02:00
Axel Naumann
5b4a3bacf8 Decls as template params need to be buffered to their stream. 2014-09-23 20:56:07 +02:00
Axel Naumann
dec7f9f964 Write declcontext for each visit; delay template <...>.
Writing the template parameters might cause visitation of other decls which need to be in their respective
namespaces. Thus we need to buffer / delay the whole template decl, including its enclosing namespaces.
As we forward e.g. from ClassTemplateInstanceDecl() to RedeclarableTemplateDecl() we need to
selectively write the enclosing namespaces, no just for any Visit(Decl*). Make sure that a template pattern
is not again writing its enclosing scopes - it is just called from its VisitRedeclarableTemplateDecl().
2014-09-23 20:56:07 +02:00
Axel Naumann
ce0b0f205d Remove skip counting; centralize skip logging. 2014-09-23 20:56:07 +02:00
Axel Naumann
2facc626bf Actually print the enclosing DeclContexts. 2014-09-23 20:56:06 +02:00
Axel Naumann
f0f6835a22 extern "C" is printed by the decl itself. 2014-09-23 20:56:06 +02:00
Axel Naumann
c216c82cde Let decls print their decl context. 2014-09-23 20:56:05 +02:00
Axel Naumann
a205da3696 Delay template parameters until its dependencies have been visited. 2014-09-23 20:56:05 +02:00
Axel Naumann
01f499d143 No need for a sub-stream; we reset m_SkipFlag. 2014-09-23 20:56:05 +02:00
Axel Naumann
52fb16d57f Automatically stream to parent if not skipped. 2014-09-23 20:56:05 +02:00
Axel Naumann
3db7197ea9 Fix fatal spelling error. 2014-09-23 20:56:04 +02:00
Axel Naumann
910832a807 Even fwd decl outside TU context. Visit tmplt arg types. 2014-09-23 20:56:04 +02:00
Axel Naumann
1027dd6e90 Introduce ASTContext member. 2014-09-22 16:36:23 +02:00
Axel Naumann
c2d0508988 Skip if needed when visiting template args. 2014-09-22 16:36:22 +02:00
Axel Naumann
585be00d64 Do not stream const vars; for static ones, do not print "extern". 2014-09-22 16:36:22 +02:00
Axel Naumann
fdadde3cd7 Handle DeclRefExp template args. 2014-09-22 16:36:22 +02:00
Axel Naumann
6c3d42eaee Write function fwd decls! Follow DeclRefExpr template args. 2014-09-19 11:17:05 +02:00
Axel Naumann
f630fd58ed Fix position of "inline" in "inline namespace" (MacOS G__MathCore failure). 2014-09-18 23:49:03 +02:00
Axel Naumann
82c69767d9 Fix mem corruption: iterator might be invalidated by insertion. 2014-09-18 23:28:04 +02:00
Axel Naumann
fa7ce40d67 Analyze and fwd declare all dependencies (ROOT-6705 ROOT-6719 ROOT-6712 ROOT-6695). 2014-09-18 23:28:04 +02:00
Axel Naumann
922f3c678b Also fwd declare types nested in namespaces. 2014-09-18 23:28:04 +02:00
Vassil Vassilev
dba2f39ff4 Print only annotate attr until type_visibility printing is fixed. 2014-09-15 14:12:06 +02:00
Axel Naumann
c4ad2ff154 Use fully qualified template args. 2014-09-14 13:53:11 +02:00
Axel Naumann
52bbebb238 Use filename spelling as #included. 2014-09-14 13:53:10 +02:00
Axel Naumann
b94722690f Prefix annotation by $clingAutoload$ to not confuse it with others. 2014-09-14 13:53:10 +02:00
Vassil Vassilev
a59cd2bb81 Silence a warning. 2014-08-22 09:19:21 +02:00
manasij7479
fb83dfe1fd Generate log statement for all skipped decls, also fixes a restrict bug 2014-08-21 17:07:01 +02:00
Bertrand Bellenot
dd7daa6d3d Replace uint by unsigned int (fixing compilation error on Windows) 2014-08-21 15:19:02 +02:00
Vassil Vassilev
5194c7811b Each annotation came from a single top most file. Walk up the loc chain.
STL contains a lot of forwarding headers. For example map forwards to bits/stl_map.
However we still need to annotate the decls that came from stl_map as if they
came from map, because semantically we would like to autoload/show hints about
map and not some 'interesting' stl implementation.

This is why we need to reconstruct the include chain and write out the second
includer. The first one is the prompt's input_line_N.
2014-08-14 15:44:02 +02:00
Axel Naumann
e8b44912d7 Fix logic warning. 2014-08-14 15:13:02 +02:00
manasij7479
b556856580 Do not blindly skip existing attributes, also fixes macro typedef redefinition issue 2014-08-14 14:56:43 +02:00
manasij7479
282ce06530 Recheck if top level decl, workaround test problem by printing pass in a loop 2014-08-14 14:56:43 +02:00
manasij7479
3c260f9e4a New log file name format, and skip function templates with default function arguments 2014-08-14 14:56:43 +02:00
manasij7479
a53c908fba Precompute end iterator, use std::strinf in some cases 2014-08-14 14:56:43 +02:00
manasij7479
ae925d97b5 Consider EnumConstant names unavailable for using decls 2014-08-14 14:56:43 +02:00