139 Commits

Author SHA1 Message Date
Axel Naumann
cb2384fc55 Buffer Interpreter-local std::string lookup; ValuePrinter needs it. 2017-05-08 11:44:07 +02:00
Philippe Canal
e173a95fc1 With module (or pcm) even trivial lookup can lead to deserialization and thus need a transaction 2017-04-11 23:00:40 +02:00
Philippe Canal
f5c7037763 Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace).
This was happening when a namespace had the same as the function in a namespace that was 'used'.  Namely,
in the issue report it was the 'next' namespace and the function std::next.

This required the quick search function in LookupHelper.cxx to properly handle the return value of utils::Lookup::Named.
2017-04-07 21:14:06 +02:00
Philippe Canal
3a1db539f6 Revert "Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace)."
This reverts commit 0728f30ead6c1cca74bf31b93dc9a1cb616a3e35.
2017-04-07 20:44:04 +02:00
Philippe Canal
68283cac47 Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace).
This was happening when a namespace had the same as the function in a namespace that was 'used'.  Namely,
in the issue report it was the 'next' namespace and the function std::next.

This required the quick search function in LookupHelper.cxx to properly handle the return value of utils::Lookup::Named.
2017-04-07 20:29:17 +02:00
Frederich Munch
d68ef916ac Use LLVM stream wrappers to reduce complexity and line counts. 2016-12-20 12:29:06 +01:00
Axel Naumann
c9ad1f4a41 Only skipToEOF if needed. 2016-11-10 18:14:07 +01:00
Philippe Canal
7c9379ac93 Refactor in RequireCompleteDeclContext the 'Update the DeclContext used for lookup to point to the definition.'
This superseeds 4fa2f7a38e37303b3bb5a9ba01d762122e8d9814, 2b4de2603a086162f89fd5eb16aa0d5fddac8a6e and 384f6eabcd2d02512b942215d7ae52ff40954027
2016-11-08 22:59:56 +01:00
Axel Naumann
3847e2560d Split ParserStateRAII into Utils/. We need it in other places. 2016-11-07 15:29:52 +01:00
Frederich Munch
e1854092b5 Move DeclUnloader and ParserStateRAII into cling namespace. 2016-09-22 15:15:27 +02:00
Axel Naumann
56e748da0e Fix Coverity CID53317 - clash with parameter name. More explicit than op bool. 2016-09-12 22:31:57 +02:00
Axel Naumann
b26d955f67 Fix Coverity CID61311 - potential null deref. 2016-09-12 22:31:56 +02:00
Frederich Munch
16b3c48e78 Windows: Use enumeration rather than 3 constexpr ints.
Allows cling to compile on VisualStudio 2013.
2016-09-09 09:29:49 +02:00
Roman Zulak
e40bd4f1a0 Syntax fixes for VisualStudio < 2015.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-20 13:14:40 +02:00
Axel Naumann
bedc277fae Simplify invocation of DeclUnloader::UnloadDecl(). 2016-06-26 18:59:08 +02:00
Axel Naumann
94bc9f4f73 Separate DeclUnloader; TransactionUnloader recurses through Interpreter. 2016-06-26 10:29:17 +02:00
Axel Naumann
1ec7136eeb Refactor, centralize all TransactionUnloading in Interpreter. 2016-06-26 10:29:17 +02:00
Axel Naumann
b2c8076707 Remove unused variable. Thanks, GCC! 2016-06-22 13:44:09 +02:00
Philippe Canal
3a5dd3a381 Remove unused variable 2016-04-30 05:44:31 +02:00
Philippe Canal
928969ebbd Remove unused variable 2016-04-30 05:44:31 +02:00
Philippe Canal
47513bfc9f Remove some memory hoarding by cling's findFunction.
Avoid creating a CXXScopeSpec (and a NestedNameSpecifierLoc) just to check whether we need
to complete a decl.
2016-04-28 17:44:30 +02:00
Philippe Canal
b96301501e Remove unused variable 2015-10-26 19:14:52 +01:00
Philippe Canal
3182648f56 Suppress more diagnostics. 2015-10-05 03:24:41 +02:00
Philippe Canal
46c2ef299a Properly pop and restore (and clean) Parser::TemplateIds 2015-10-05 03:24:41 +02:00
Philippe Canal
975caef006 Push/pop value of Sema::InNonInstantiationSFINAEContext.
This avoid 'suppressed diagnostics to be nonetheless pick up for the SFINAE mechanism/implementation
2015-10-05 03:24:40 +02:00
Bertrand Bellenot
384c721750 Fix compilation errors on Windows (error C2065: 'constexpr' : undeclared identifier ) 2015-10-01 14:22:06 +02:00
Philippe Canal
47c7af8967 Fix doxygen comments 2015-09-30 16:51:02 +02:00
Philippe Canal
70c402f585 Event quickFindType can lead to deserialization 2015-09-29 21:50:04 +02:00
Philippe Canal
50e1fe55cd Don't add spurrious const to a ref type 2015-09-29 19:18:04 +02:00
Philippe Canal
63f19daf03 Documentation justification for hand coded shortcut.
To handle 'Float_t*', quickFindType uses no memory (instead of 183B for findType) and is much faster
(6 times in this case), the cost is the additional ('unnecessary') checks in the cases not handled by
quickFindType.
2015-09-29 08:38:05 +02:00
Philippe Canal
cc7cfa6332 Extract routine quickFindType 2015-09-29 00:54:06 +02:00
Philippe Canal
2555f2e6e8 Remove debug statements 2015-09-29 00:54:06 +02:00
Philippe Canal
5ec73f0aa2 Extent and complete findType's use of quickFindDecl.
Requires to add code specific for builtins types (somehow not found by cling::utils::Lookup::Named).
White spaces fixes
2015-09-29 00:54:06 +02:00
Philippe Canal
426a1c4f4f Add more characters 'illegal' on quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
795b215716 Use quickFindDecl in findType (need more adaptations) 2015-09-29 00:54:05 +02:00
Philippe Canal
2f40299656 Move findType below quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
2aff147565 quickFindDecl: use more generic parameter name 2015-09-29 00:54:05 +02:00
Philippe Canal
c9b19691af Document quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
5ecfd9525f fix scope. 2015-09-29 00:54:05 +02:00
Philippe Canal
b202613de5 Extract 'quick decl find' out of findScope 2015-09-29 00:54:05 +02:00
Philippe Canal
1330bd1fe4 Fix ROOT-7462 (extend fix for ROOT-6070)
Original problem:

set atlas shell environment
root.exe
   TFile *_file0 = TFile::Open("atlasfile.root");

bunch of Warning about missing dictionary

   c = TClass::GetClass("GaudiCommon<Algorithm>")

Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class GaudiUtils::Map<string,SmartIF<IService>,__gnu_cxx::hash_map<string,SmartIF<IService>,GaudiUtils::Hash<string>,equal_to<s
tring>,allocator<SmartIF<IService> > > >
Error in <CreateRealData>: Cannot find data member # 0 of class GaudiUtils::Map<string,SmartIF<IService>,__gnu_cxx::hash_map<string,SmartIF<IService>,GaudiUtils::Hash<string>,equal_to<string>,allocator<SmartI
F<IService> > > > for parent GaudiCommon<Algorithm>!

   c->GetListOfRealData()->ls();

...
OBJ: TRealData m_services      Description of persistent data members : 0 at: 0x9d46d70
OBJ: TRealData m_errors        Description of persistent data members : 0 at: 0x9d47cb0
...

Tweak of the problem:

  c = TClass::GetClass("GaudiCommon<Algorithm>");
  c->GetListOfRealData()->ls();

...
OBJ: TRealData m_services      Description of persistent data members : 0 at: 0x300ce10
OBJ: TRealData m_services.     Description of persistent data members : 0 at: 0x300e9c0
OBJ: TRealData m_errors        Description of persistent data members : 0 at: 0x300eaa0
...

Note: no error or warning but the ListOfRealData is 'wrong'.

Correct behavior:

   TClass::GetClass("SmartIF<IService>");
   TFile *_file0 = TFile::Open("atlasfile.root");
TClass::GetClass("GaudiUtils::Map<string,SmartIF<IService>,__gnu_cxx::hash_map<string,SmartIF<IService>,GaudiUtils::Hash<string>,equal_to<string>,allocator<SmartIF<IService> > > >");
   c = TClass::GetClass("GaudiCommon<Algorithm>");
   c->GetListOfRealData()->ls();

...
OBJ: TRealData m_services      Description of persistent data members : 0 at: 0xc81c820
OBJ: TRealData m_services.m_map        Description of persistent data members : 0 at: 0xc81dd00
OBJ: TRealData m_errors        Description of persistent data members : 0 at: 0xc81ddb0
...

See autoparse for
unary_function<pair<const string,SmartIF<IService> >,const string>
SmartIF<IService>

Analysis:
  1) Opening the file triggering the autoloading of a lots of libraries and the autoparsing of many files.
     This includes the declaration of Gaudi::Map but *not* of SmartIF nor SmartIF<IService>.
     [Side note: this autoloading is due to DataVector<xAOD::Jet_v1> not having a dictionary]
  2) During TClass::GetClass("GaudiCommon<Algorithm>"), the TProtoClass::FillTClass is called and
     disable autoloading and autoparsing and then request the GaudiUtils::Map
  3) Since there is no dictionary for GaudiUtils::Map, findScope is invoked.
  4) During findScope, the instantiation of GaudiUtils::Map fails with an error similar to:
        error: field has incomplete type 'SmartIF<IService>'
  5) The error handling code path in this case in findScope did *not* revert the transaction
     and unload the 'invalid' decl for the GaudiUtils::Map
  6) TClingClassInfo assume all decl are valid but finds and use the invalid decl
  7) In this case, the invalidity of the decl leads to a lack of data members
  8) Thus TProtoClass::FindDataMember complains about the discrepency between the TProtoClass
     information and the information from the decl.

Requesting the TClass for the GaudiUtils::Map when autoloading and autoparsing are leads
to the proper instantiation and thus success.

Requesting the TClass for GaudiCommon<Algorithm> before loading the file means that
when the request for the TClass for GaudiUtils::Map is done, the declaration for
GaudiUtils::Map has not yet been parsed and thus findScope use a different error
handling code path (one where the instantiation is not even attempted).

In normal circunstances (all dictionary properly generated and loaded/loadable),
the missing name part in the list of real data member is not fatal (it would be
if it was the case during the initial gathering of information but as it is, all
the necessary information is already in the rootpcm files).
2015-08-17 18:45:03 +02:00
Axel Naumann
94dace589c Lookups can deserialize / instantiate and need Transactrions. 2015-03-10 12:02:03 +01:00
Axel Naumann
16fe3f49dc Replace use of ExecutionEngine by OrcJIT. 2015-02-11 10:57:47 +01:00
Axel Naumann
b59de8a40a Adapt to clang/llvm changes (mostly ownership). 2015-02-11 10:57:43 +01:00
Axel Naumann
cb18d9bc09 Also store Parser paren numbers; likely fixes ROOT-6976:
The parser (or rather the BalancedDelimiterTracker) was doing a Parser::cutOffParsing() because
of an overflow of open ( - because we never reset the count.
2015-01-08 18:36:10 +01:00
Axel Naumann
ad54637904 Argument parsing can trigger ASTReading; needs transaction (ROOT-6625). 2014-11-20 11:22:17 +01:00
Philippe Canal
dfb67a3707 Correct casing 2014-09-15 12:50:11 +02:00
Philippe Canal
2f824506dd Introduce shortcut in LookupHelper::findScope.
In simple case not involving templates or template instantiation, avoid creating a memory
buffer and calling the Parser.
2014-09-15 12:26:14 +02:00
Philippe Canal
b714047cbb Reduce code duplication 2014-09-12 14:05:03 +02:00
Philippe Canal
96029946fc PrepareForParsing should no longer be called with empty code 2014-09-12 14:05:03 +02:00