Commit Graph

2134 Commits

Author SHA1 Message Date
Elisavet Sakellari
8f51dd1617 Remove default values in IncrementalParser functions 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
b0bdcf4c56 First commit for the Multiple Interpreters. 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
ee92892ad4 First commit for the Multiple Interpreters 2016-01-14 20:44:14 +01:00
CristinaCristescu
8495dc7dd8 Cosmetics of NullDerefProtectionTransformer + isDeclCandidate CXXMemberCallExpr case.
If we have a CXXMemberCallExpr we do not check the arguments of the call,
we only check the callee.
2016-01-14 20:44:14 +01:00
CristinaCristescu
b5594df690 Refactor NullDerefProtectionTransformer.
The class NodeContext was removed since collecting individual Stmts
is not necessary, due to the change of how the visiting of one
single Stmt is done, which now recurses on the children of the Stmt.
Thus, the AST is changed directly by the VisitX methods.

VisitCompoundStmt is not necessary since the CompoundStmt derives from
Stmt and the collection of Stmt of the CompounStmt is visited
through the children visitation.

VisitCXXMemberCallExpr is now covered by the recursive visiting in the
VisitCallExpr method.
2016-01-14 20:44:14 +01:00
CristinaCristescu
94dd1ea523 Visit Stmt children for null deref check.
The previous version of the Null deref visitor was defaulting to
VisitStmt when the Stmt type was unknown, thus allowing for some
types of Stmt X for which a VisitX was not implemented to default
to VisitStmt and not check the content of it. In order to check
any type of Stmt for possible subexpressions which contain s Stmt
that derefrences a Null, the VisitStmt was extended to check its
children.

Only the Stmt types, X, which directly containing a null deref expression
have an explicit VisitX with the exception of CXXMemberCallExpr,
because this type would otherwise default to VisitCallExpr which has
a different check for its structure.
2016-01-14 20:44:14 +01:00
CristinaCristescu
932860cbb2 Replace AST node with node containing NullDeref check and fix NullDeref/Iterator.C test.
Initially the NullDerefProtectionTransformer was prepending a
If statement before the possible Null derefrencing. This was
chenged by a runtime function call which included the check
for Null and invalid address memory, but was replacing the
whole AST node so the parent node of the Expr type would disappear,
resulting in a wrong AST. The correct solution was to replace the
SubExpr of the Expr that contained a possible Null derefrencing.
This was done by using the specific setters for each Expr type
that is detailed in the NullDeref Visiting.
2016-01-12 15:14:08 +01:00
CristinaCristescu
44aa4a6180 Add parameter description to avoid warning generation. 2016-01-07 16:29:07 +01:00
Axel Naumann
ba8e6b2834 Add install dir to cling include path; move -DCLING_VERSION.
The latter fixes CMake cling tests.
2016-01-02 20:48:01 +01:00
Philippe Canal
a11b9e384e Fix cling::utils::GetPartiallyDesugaredTypeImpl for C++14.
Fix cases (seen in roottest/cling/typedef/assertTypedefIter.C) where
a template parameter is an expression that is actually part of a
template parameter pack.  In this case we need to peek into the pack.
2016-01-02 20:48:01 +01:00
CristinaCristescu
d557ed9506 Doxygen compliant comment. 2015-12-18 14:29:05 +01:00
CristinaCristescu
e89f3d6e32 Remove injected ifstmt for invalid derefrencing.
The previous invalid refrence transformer injected if stmt for checking the argument derefrenced.
Now we return a runtime call that checks for validiting for derefrencing and injects the call
into the AST replacing the node where the deref happens with a call to the runtime function.
2015-12-18 14:29:04 +01:00
CristinaCristescu
5d6f86f805 Invalid referrencing runtime call casted to appropriate type. 2015-12-18 14:29:04 +01:00
CristinaCristescu
21b342105b Comment explaining function argument const cast. 2015-12-18 12:44:09 +01:00
CristinaCristescu
c5a42b19af Invalid referrencing runtime call casted to appropriate type. 2015-12-18 12:44:09 +01:00
Axel Naumann
a70623e7e3 Add dependency needed for DiagnosticCommonKinds.inc. 2015-12-18 10:15:18 +01:00
Axel Naumann
2023eac193 Put LINK_LIBS back, they are used by ROOT. 2015-12-16 20:29:22 +01:00
Axel Naumann
6eac3e3159 Define dependencies! 2015-12-16 20:29:22 +01:00
Axel Naumann
ca23c88748 Determine OptLevel for TargetMachine from CodeGenOpts. 2015-12-15 20:24:16 +01:00
Axel Naumann
9c0d626cda Use -O as set through arguments. 2015-12-15 20:24:16 +01:00
Axel Naumann
3f650b08c5 Revert "Set optimization level from -O argument when creating TargetMachine."
This reverts commit 73b3a1dbf9ef8760b9e6f335b7bbafbc21247555.
We'll use clang's parsing of -O... instead.
2015-12-15 20:24:16 +01:00
CristinaCristescu
fb8bc80796 Fix max 80 columns in cling files. 2015-12-15 20:24:16 +01:00
Yves Le Maout
62d51e5f8a Set optimization level from -O argument when creating TargetMachine. 2015-12-15 20:24:16 +01:00
Yves Le Maout
890e4b2e2a If -nostdinc++ was provided, do not determine standard library include paths. 2015-12-15 20:24:16 +01:00
Axel Naumann
9575ece7df Uniform member init. 2015-12-15 20:24:16 +01:00
CristinaCristescu
95e3dcf8ef Check for invalid pointer address access. 2015-12-15 20:24:16 +01:00
CristinaCristescu
b44cf929ba Cache the lookup of the runtime functions in the synthesizers of the transformers. 2015-12-15 20:24:16 +01:00
CristinaCristescu
7556d3814d NullDeref check changed from injection of if(stmt) to a runtime call. 2015-12-15 20:24:16 +01:00
Axel Naumann
25bbe0c617 Cache Dtor wrappers (used by ~Value); reduce calls to dlsym (ROOT-7840).
This fixes a PyROOT performance regression between 6.02 and 6.04, seen by ATLAS.

(cherry picked from commit ba4b0df02a91be4102e62fc76038711d188f07f3)

Conflicts:
	interpreter/cling/lib/Interpreter/Value.cpp
2015-12-15 20:24:16 +01:00
Axel Naumann
923b4ce39b Also strip the "runtime" part of the Interpreter exception here. 2015-12-15 20:24:16 +01:00
CristinaCristescu
1d46fe88d8 Remove runtime namespace from NullDerefException and rename RuntimeException.h to Exception.h.
(cherry picked from commit 234da8bfedce8661c2b8bc50f72632c240c4dfd8)
2015-12-15 20:24:16 +01:00
CristinaCristescu
8ab37ec3d6 Enable Baozeng Ding's NullDeref protection for ROOT; use exceptions.
The function HandleInterpreterException catches the NullDerefException.
Remove pre-exception longjmp code.
2015-12-15 20:24:15 +01:00
Vassil Vassilev
96b189e8d7 Remove new lines. 2015-12-15 20:24:15 +01:00
Philippe Canal
9a9004c501 Correct the name of bundle function of global initializer.
This correctly follow the clang commit afafe70f43dbb614f336ccbede1c4bbb132ec658
See https://root.cern.ch/gitweb?p=clang.git;a=commit;f=lib/CodeGen/CGDeclCXX.cpp;h=afafe70f43dbb614f336ccbede1c4bbb132ec658
and fixes the first attempt (75456cd17689730089526417c0d28ba4ed244f58).
2015-12-15 20:24:15 +01:00
Axel Naumann
30cc58a5c6 Reset diagnostics after parsing arguments: we shall issue an error but survive (ROOT-7619, ROOT-7614 and others). 2015-11-03 00:01:43 +01:00
Philippe Canal
81fef9a7b4 Add support for Parameter packs in type(name) normalization.
This fully resolve ROOT-7708.
2015-10-28 19:44:14 +01:00
Philippe Canal
2c9a79514e White spaces 2015-10-28 19:44:14 +01:00
Philippe Canal
b96301501e Remove unused variable 2015-10-26 19:14:52 +01:00
Philippe Canal
36e5b1eec0 Use isa (instead of dync_cast) for type testing 2015-10-23 18:22:26 +02:00
Philippe Canal
432884aada Add a callback during Transaction's rollback. 2015-10-22 14:56:16 +02:00
Philippe Canal
d58b99d1ed Must unload content before removing context from decl chain 2015-10-22 14:56:15 +02:00
Philippe Canal
5474fb5da7 When removing a definition decl, make the other forget about it 2015-10-22 14:56:15 +02:00
Axel Naumann
be55c83f9b Inline Value move ctor to enable the compiler to skip it. 2015-10-20 01:50:13 +02:00
Philippe Canal
26fdb651b9 PrimaryContext returns non null for forward decl, so we need to also grab the def.
This redo d78dac6 that was thought to be superseeded by ca32227
2015-10-15 22:45:06 +02:00
Philippe Canal
32bd423d59 We must pass the primary decl context to Sema's LookupQualifiedName [ROOT-7737].
This is guarded by an assert in Sema::LookupQualifiedName.
2015-10-15 21:33:13 +02:00
Philippe Canal
a0005a7484 Fail more elegantly in ValuePrinter 2015-10-09 19:11:05 +02: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
Danilo Piparo
c85ce99057 Re-enable "In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType."
This reverts commit 944b1d4fed1851b67236be756094a68be26ae0c2.
2015-10-02 14:09:06 +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
8065dfa723 Support gcc 4.9.3's C++14-ish 2015-09-30 23:42:06 +02:00
Philippe Canal
47c7af8967 Fix doxygen comments 2015-09-30 16:51:02 +02:00
Philippe Canal
75fac59326 Coding conventions fixes 2015-09-30 16:41:12 +02:00
Philippe Canal
30352c97a3 Re-enable c00daa7 with handling of the case of 'missing' transactions.
This reverts commit 22c7eb4ae85145682bb0236b6b607188de174992.
2015-09-30 15:51:03 +02:00
Philippe Canal
1f0659d9b0 Remove warning message (intentional const cast) 2015-09-29 23:52:04 +02:00
Philippe Canal
9c88696445 Implement TCling::ResetGlobals to fix ROOT-7673.
Note we don't want to unload transaction so soon as this might remove the header files still needed
(they need to be removed by the library .... which is still a to-be-done feature)
2015-09-29 22:49:05 +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
040bad9a53 Revert "In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType."
This reverts commit 5190ebeb2eb0ac527881ab1c91401b20f4e54b39.

It fails on roottest/root/meta/dictSelection:execAtlasTest2
2015-09-24 15:14:01 +02:00
Philippe Canal
f1fd8d0fd0 In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType.
When the type comes (directly or indirectly) from being used as a template paramater, it is decorated
by SubstTemplateTypeParmType which gets in the way of properly getting the name correct (leads to
'std::const string'.
2015-09-24 11:15:18 +02:00
Philippe Canal
df44a9d01d Use canonical type when making type based decision 2015-09-24 11:15:18 +02:00
Philippe Canal
569ef839cb Implement DeclCollector::HandleInvalidTagDeclDefinition.
This allow the transaction from noticing and removing invalid decl (appear during template instantiation)
2015-09-23 09:43:03 +02:00
Axel Naumann
b7ceb3550e Keep pending instants upon unload. Fixes CMS missing symbol. 2015-08-26 08:46:03 +02:00
Axel Naumann
dec5717d4c Fix printing of false! (And add a test.) 2015-08-21 12:23:04 +02:00
Boris Perovic
39f64ab7b7 Catch-all printValue implementation changed to enable correct invocation if only parent type overload exists (ex. if there is no overload for TF1*, compiler invokes the overload to its best parent overload match, in the worst case void*). Argument changed from reference to pointer to support this. isEnumType Coverity bug changed from if to assert (coding, not runtime error) Changed the way printValue is invoked in order to correctly cast Value to the needed value (e.g. LL -> short). Extracted value stays in scope while we execute printValue, because we use the address. 2015-08-20 17:06:02 +02:00
Boris Perovic
fc447d5fd5 Small improvements. nullptr -> nullptr_t for isNullPtrType 2015-08-18 18:08:20 +02:00
Boris Perovic
800c644352 Removed "VALID" after address output, fixes roottest. Various fixes based on comments after second round. 2015-08-18 18:08:20 +02:00
Boris Perovic
2d317b983d Fixes based on cling test suite ("make test"). 2015-08-18 18:08:20 +02:00
Boris Perovic
34b8b73a30 Fixed potential bug found by Coverity (https://coverity.cern.ch/reports.htm#v13142/p10001). 2015-08-18 18:08:19 +02:00
Boris Perovic
f7cf46ab31 Removed old Stream functions from ValuePrinter.cpp. 2015-08-18 18:08:19 +02:00
Boris Perovic
1aa5329d74 Simplified printValue(const char *const val). 2015-08-18 18:08:18 +02:00
Boris Perovic
e7d605bccc Changed using of QualifiedType.getAsString() to cling::utils::TypeName::GetFullyQualifiedName(QualifiedType, ASTCtx). 2015-08-18 18:08:18 +02:00
Boris Perovic
127f226acd Extracted printing of unpacked Values. Minor comment fixes. 2015-08-18 18:08:18 +02:00
Boris Perovic
a9825d50dc Removed unused function hasViableCandidateToCall (overload resolution and general fallback deals with this now). Moved isAddressValid function from Value.cpp to ValuePrinter.cpp and implemented the check for void*. 2015-08-18 18:08:18 +02:00
Boris Perovic
517eab8df1 Removed old printValue_Default and printType_Default methods. Using fully qualified name in new printType_New method. 2015-08-18 18:08:18 +02:00
Boris Perovic
688ad34b3f Minor fixes around printValue, based on comments after the integration. 2015-08-18 18:08:17 +02:00
Boris Perovic
62c71df1fa Minor fix: print type + " " + value, rather than type" " + value. 2015-08-17 18:45:03 +02:00
Boris Perovic
c44940b223 New printValue() integration (printing unified through overloading of printValue() function and template resolution). Modified tests to conform to the new prints. 2015-08-17 18:45:03 +02:00
Boris Perovic
187cbaf257 Do not randomly add to lookup results during EvaluateT(). 2015-08-17 18:45:03 +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
e2f9cf80cd Assert to error: cannot autoload that, its declaring header cannot be found at runtime! 2015-08-17 18:45:03 +02:00
Elisavet Sakellari
d2953ff9a6 Handling of multiple Redirection RAII's 2015-08-17 18:45:02 +02:00
Pere Mato
768254099f Enable C++14 in Cling when compiling with C++14 enabled 2015-08-17 18:45:02 +02:00
Pere Mato
5e5af173cf Forward the c++14 flag to building LLVM/CLING. Enable c++14 in the interpreter if compiled with -std=c++1y or -std=c++14. 2015-08-17 18:45:02 +02:00
Axel Naumann
2a73fc3b9e Grab lang, PP, target opts from PCH if it exists. 2015-08-17 18:45:02 +02:00
Axel Naumann
a0618d59f4 whitespace. 2015-08-17 18:45:02 +02:00
Axel Naumann
7217f8099b Silence *calling* unresolved symbols. Handing it out already complains. 2015-08-17 18:45:02 +02: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
cfd091955e Pass pthread to CIFactory; enable it in LangOpts. 2015-06-23 21:30:17 +02:00
Axel Naumann
3d4bb2b954 Fix fwd-decl detection and loops. 2015-06-23 11:13:16 +02:00
Axel Naumann
13dae8ee6b The RecursiveASTVisitor now calls Visit of bases itself. 2015-06-23 11:13:16 +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
Bertrand Bellenot
3eed26e5a5 Fix load error reported on the forum (https://root.cern.ch/phpBB3/viewtopic.php?f=21&t=19840) 2015-06-17 10:50:29 +02:00
Bertrand Bellenot
b5b37f564c Add a funtion to check if a file is a DLL, using proper WIN32 API 2015-06-09 17:22:06 +02:00
Axel Naumann
1c190f711f RevertTransaction() changes parent: assert on m_Transactions.back() first. 2015-06-09 11:03:18 +02:00
Axel Naumann
331a71cd2d Provide a valid SourceLoc - template instantiation needs it (ROOT-7364). 2015-06-08 18:10:01 +02:00
Axel Naumann
dc2047e7c4 Replace Transaction::reset() by ~Transaction(). Replace RefillPool by new Transaction.
Simplifies code, removes duplication.
2015-06-08 14:58:29 +02:00
Axel Naumann
886f586b08 Add assert; spelling. 2015-06-08 14:58:27 +02:00
Axel Naumann
439869b8c2 Use magic ExeUnload handle to tag "nothing to be unloaded".
This disambiguates a transaction without JITted module from one with JITted code.
Only the latter should be unloaded.
2015-06-08 14:58:27 +02:00
Axel Naumann
44ee56b7a1 Also unload modules that are queued for JITting. 2015-06-08 14:58:25 +02:00
Axel Naumann
e21b7319f3 Fix var name typo in find_first_not_of; combine if-s. 2015-06-08 11:20:18 +02:00
Axel Naumann
14719848cc Do not shadow parameter name (Coverity 60786). 2015-06-07 20:54:00 +02:00
Axel Naumann
7b0cae3aef Use non-shadowing param name (Coverity 61660). 2015-06-07 20:53:59 +02:00
Axel Naumann
77b6a92f5c Handle npos / not found, 2nd occurrence (Coverity 55587). 2015-06-07 20:38:21 +02:00
Axel Naumann
4e4ff52556 Handle npos / not found (Coverity 55587). 2015-06-07 20:38:20 +02:00
Axel Naumann
9e100c5dc5 Handle npos / not found (Coverity 55588); indentation; local vars. 2015-06-07 20:38:18 +02:00
Axel Naumann
926f9072ea Unbalanced store/compare can be usage error; diagnose, not assert. 2015-06-07 20:38:15 +02:00
Elisavet Sakellari
bfa9947c5a Implement search path cling pragma / ROOT macros (ROOT-7269). 2015-06-04 16:40:08 +02:00
Axel Naumann
a1d3eabd7e Revert "Remove dupe code: CurT->setIssuedDiags() already done in endTransaction()."
ParseResult could be failure withous Diags noticing.

This reverts commit 6d0a73cb0acb3cbb62460759bc17e85ff9aba53f.
2015-06-04 12:05:04 +02:00
Axel Naumann
816232980c Delay resetting Diags until the Module has been released by Codegen. 2015-06-04 09:56:12 +02:00
Axel Naumann
6fc85c1883 Remove dupe code: CurT->setIssuedDiags() already done in endTransaction(). 2015-06-04 09:56:10 +02:00
Axel Naumann
aa24ff9e20 Do not leak on error (Coverity). 2015-06-03 11:01:27 +02:00
Bertrand Bellenot
15dda8ada2 Fix object format on Windows (thanks Axel for the hint!)
Solves the following error on Windows (as reported on the forum: https://root.cern.ch/phpBB3/viewtopic.php?f=21&t=19033):
[cling]$ int i = 0;
>>> Caught an interpreter exception!
>>> Incompatible object format!
2015-05-28 15:17:02 +02:00
Axel Naumann
7db73eb500 Reduce cling leakage to 0, according to valgrind. 2015-05-27 18:00:09 +02:00
Axel Naumann
9b61560c4a Extra paren against hex address followed by a dot. 2015-05-24 21:55:24 +02:00
Liza
99de1fe5c0 ROOT-7031 bug fix for illegal macros. 2015-05-21 20:24:10 +02:00
Axel Naumann
4ebef94da8 Unwrap (implicit) casts for fwd decls (ROOT-7276). 2015-05-18 15:24:09 +02:00
Bertrand Bellenot
4d4a4b1270 Fix compilation error on Windows (MSVC doesn't support m_AtExitFuncsSpinLock = ATOMIC_FLAG_INIT; in the class definition) 2015-05-18 11:42:19 +02:00
Axel Naumann
25b4369647 Only emit Value return placement new for CallInit (ROOT-7310). 2015-05-13 12:12:00 +02:00
Philippe Canal
67ffd34dd5 In GetPartiallyDesugaredTypeImpl fix type replacement.
When looking up in the list of type to be replaced by a typedef (basic_string -> string), use
the canonical type to make sure we have the right search (any sugar will make the search fail).
2015-05-08 19:46:12 +02:00
Axel Naumann
5aa38ee07a Enable new GCC 5.1 ABI. 2015-05-08 01:06:49 +02:00
Axel Naumann
ea307f050c Factor out PP binary and target defines. 2015-05-08 01:06:49 +02:00
Philippe Canal
2fc94b3fa9 Remove code duplication 2015-04-17 02:50:36 +02:00
Philippe Canal
e216aea985 Add __CLING__clang__ and __CLING__GNUC__.
Those macros are define only in 'interpreted' code and respectively
only if cling itself was built with clang or gcc.
2015-04-16 08:44:51 +02:00
Axel Naumann
219d68f641 More performant version of getting the underlying type. 2015-04-09 17:18:30 +02:00
Axel Naumann
397f6fb9e9 Fix warning; make determineStorageType() static. 2015-04-07 09:39:25 +02:00
Axel Naumann
ca9ac1961f Accelerate costly Value functions by storing results. 2015-04-06 21:30:19 +02:00
Axel Naumann
474d518615 Attooptimization. 2015-04-04 21:05:14 +02:00
Axel Naumann
7364a9de6b Simplify LexQuotedStringAndAdvance; fix remaining cling test failure. 2015-04-04 20:51:20 +02:00
Axel Naumann
e1d7d5dab7 Replace quote/apostrophe by complete literals. 2015-04-04 20:51:20 +02:00
Bertrand Bellenot
9532d5481e Add missing include 2015-04-02 10:18:06 +02:00
Axel Naumann
f8ed0f4f11 Remove unused code. 2015-04-01 12:15:23 +02:00
Axel Naumann
8552299b66 Support DynamicLookup test resolver not resolving anything. 2015-04-01 12:09:19 +02:00
Axel Naumann
61291c5113 Support CXXDependentScopeMemberExpr for EvalT (ROOT-7163). 2015-04-01 12:09:17 +02:00
Bertrand Bellenot
ff885342b2 Fix CMake error with stand-alone cling
Use absolute PATH when checking the existance of the textinput directory. This prevent this error:

CMake Error at cmake/modules/AddLLVM.cmake:312 (add_library):
  Cannot find source file:

    C:/build/workspace/cling-test/src/core/textinput/src/textinput/Editor.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  tools/cling/CMakeLists.txt:142 (llvm_add_library)
  tools/cling/lib/UserInterface/CMakeLists.txt:17 (add_cling_library)
2015-04-01 09:55:10 +02:00
Axel Naumann
fb159e163c Prevent unhandled warning about switch cases. 2015-03-31 16:47:10 +02:00
Liza Sakellari
529b0aed53 Fixed parsing of '\'' at the prompt (ROOT-7159). 2015-03-31 16:47:10 +02:00
Liza Sakellari
91b011604b Fixed escaping strings in xCommand.
When calling a macro with arguments like: " \" " or " \\" etc.
Macros without arguments are now passing "()"; checking of
argument count is now done by Sema.
2015-03-31 16:47:10 +02:00
Liza Sakellari
19ce2d03b6 Fixed bug "Parser error when calling a macro with arguments". 2015-03-31 16:47:09 +02:00
Axel Naumann
2c511e072f Work around clang (XCode 6.0; fixed since) diag bug. 2015-03-30 20:21:10 +02:00
Axel Naumann
c4a8f069d3 Register $PWD with its full name (ROOT-7114). 2015-03-25 20:03:28 +01:00
Axel Naumann
a0dfd6f352 Try to work around MacOS 10.9 warning. 2015-03-24 15:13:52 +01:00
Axel Naumann
5cd294491b std::array was invented for people like me: fix sizeof. 2015-03-24 11:34:36 +01:00
Axel Naumann
663ebfa389 Fix warning. 2015-03-23 17:24:00 +01:00
Axel Naumann
5fa5b84d2b Fix off by one in .debug value. 2015-03-23 10:09:02 +01:00
Axel Naumann
3136974871 Fix doxygen warnings. 2015-03-20 15:45:03 +01:00
Axel Naumann
c431fc9d3e Make debug symbols optional (.debug). 2015-03-20 15:39:23 +01:00
Axel Naumann
bf6f3df7c7 The llvm::JITEventListener is lifetime managed by llvm. 2015-03-20 15:39:23 +01:00
Axel Naumann
fe866a3d2a Provide (possibly updated) CodegenOpts to StartModule. 2015-03-20 15:39:23 +01:00
Axel Naumann
0d497b513f Only CodeGen::HandleTU for topmost transactions. 2015-03-20 15:39:23 +01:00
Axel Naumann
ad16c82748 Enable debug info in CodeGenOptions. 2015-03-20 15:39:23 +01:00
Axel Naumann
fa03cc7c5a Hand JITed symbols to GDB. 2015-03-20 15:39:23 +01:00
Axel Naumann
8497d89e4a Spell !.size() as .empty(). 2015-03-20 12:43:51 +01:00
Axel Naumann
1d2d6e8650 No need for a nested transaction while parent is collecting! 2015-03-20 12:43:51 +01:00
Axel Naumann
c245203e7f Rollback: inform new end that next is gone. Simplify assert. 2015-03-20 12:43:51 +01:00
Pere Mato
8a75957803 Fix for waning in ROOT-7184 2015-03-19 17:50:44 +01:00
Axel Naumann
cbb9c8314e Survive empty sources (thanks, Olivier!). 2015-03-18 17:26:45 +01:00
Axel Naumann
fa573cf5de Inform commitTransaction() about the ParseResult. 2015-03-18 15:15:01 +01:00
Axel Naumann
1202db7aa7 Store error state in Transaction; DeclCollect even on error (to be able to unload). 2015-03-17 14:06:41 +01:00
Axel Naumann
f0e446aedf Do not emit if there are parse or trnasformation errors. 2015-03-17 14:06:40 +01:00
Axel Naumann
5a26caa30a Also capture errors from ASTTransformers. 2015-03-16 20:59:38 +01:00
Axel Naumann
4fe3173737 Delay Diags reset until commit which still needs it. 2015-03-16 20:31:44 +01:00
Axel Naumann
c282dcb4e7 Also commit (finalize) Transactions that have errors. 2015-03-16 20:14:49 +01:00
Axel Naumann
b5f1143670 Reset Diags once the are captured in EParseResult (cling tests). 2015-03-16 20:14:47 +01:00
Axel Naumann
75cb48f78b We like empty transactions. 2015-03-16 18:04:40 +01:00
Axel Naumann
690d4b0578 Rename ASTTransformer.h -> TransactionTransformer.h. 2015-03-16 15:24:52 +01:00
Axel Naumann
fc9b3aa997 Separate Transaction* and parser success: a nullptr Transaction* was ambiguous. 2015-03-16 14:58:58 +01:00
Axel Naumann
b8e2f69b7c Do not reset diagnostics in unloader; caller might need to know! 2015-03-16 14:58:58 +01:00
Axel Naumann
260f8d4f2a Now that parsing also emits, non-parsed Decls need to be emitted "by hand". 2015-03-16 14:58:58 +01:00
Axel Naumann
166032069e Emit Decls as DeclCollector sees them.
Now that we can easily revert Transactions' IR (by unloading their
module) we do not need to queue the Decls before emitting them.
This enables EndOfTU actions to be emitted seeminglessly, without
extra transactions, or explicit post-EndOfTU-emission: each
Transaction will have its TU finalized exactly once.

This in turn allows us to turn on Debug emission - which relies on
being invoked exactly once per Module.

Transformers must be invoked before emitting Decls. They are now
invoked for each Decl; WrapperTransformers are invoked when seeing
a wrapper decl. They do not see the "full transaction AST" anymore
- luckily none of our transformers requires this and actually become
simpler because of this change.

This also fixes a bug where the relative sequencing of parsed and
deserialized Decls was lost (parsed was emitted before deserialized).

Remove unused IRTransactions; they should really be llvm::Pass-es.
We don't have them anyway.

Disable a few transformations if the Decl isFromASTFile.

When reverting a Transaction, also revert its nested ones.

In the ValueExtractionSynthesizer, pass the ValuePrinter option as
int, instead of the transaction pointer - that might have changed
(at least its options) by the time we invoke the wrapper.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i or -o; assuming --only paths...
# rebase in progress; onto b3d9f92
# You are currently splitting a commit while rebasing branch 'declcollector-emits-v2' on 'b3d9f92'.
#
# Changes to be committed:
#	modified:   interpreter/cling/include/cling/Interpreter/RuntimeUniverse.h
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.h
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.h
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.cpp
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.h
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.cpp
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.h
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionUnloader.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.h
#
# Untracked files:
#	.idea/
#	0001-Fix-llvm-merge-issue.patch
#	0002-Fix-warnings.patch
#	0003-Keep-weak-symbols-around-subsequent-transactions-mig.patch
#	T.cxx
#	T.cxx~
#	TMVA.root
#	a.out
#	boost.root
#	config/Makefile.depend~
#	core/textinput/src/textinput/TerminalDisplayWin.cpp.orig
#	ct.root
#	data.root
#	interpreter/cling/76fc2055249da7b03148a7d4197a279e9943f012.patch
#	interpreter/cling/lib/Interpreter/CIFactory.cpp~
#	interpreter/cling/lib/Interpreter/DeclCollector.h~
#	interpreter/cling/lib/Interpreter/DynamicLibraryManager.cpp~
#	modulemap-one-header-per-file.txt
#	osrm-routed
#	tiles.tar.bz2
#	tmva_class_example.root
#	tutorials/v3.root
#	weights/
#
2015-03-16 14:58:58 +01:00
Axel Naumann
7e1e0fe82d Parse DynamicLookupRuntimeUniverse.h with DynamicLookup disabled. 2015-03-16 14:58:57 +01:00
Axel Naumann
d7fe2ccc90 Remove unused file. 2015-03-16 14:58:57 +01:00
Philippe Canal
cac03e9080 Coding conventions 2015-03-16 13:12:47 +01:00
Philippe Canal
5842d86a2f Protect IncrementalExecutor::m_AtExitFuncs with a spin lock.
This prevents:

==4150== Possible data race during write of size 8 at 0xCC136F0 by thread #3
==4150== Locks held: none
==4150==    at 0x146EC214: llvm::SmallVectorTemplateBase<cling::IncrementalExecutor::CXAAtExitElement, false>::grow(unsigned long) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc491/lcg/root/6.02.00-lnjiaj2/lib/libCling.so)
==4150==    by 0x146E9DE3: cling::IncrementalExecutor::AddAtExitFunc(void (*)(void*), void*, cling::Transaction const*) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc491/lcg/root/6.02.00-lnjiaj2/lib/libCling.so)
==4150==    by 0x160A5044: ???
==4150==    by 0x160A67D6: ???
==4150==    by 0x160A6783: ???
==4150==    by 0x145E76D3: TCling::ExecuteWithArgsAndReturn(TMethod*, void*, void const**, int, void*) const (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc491/lcg/root/6.02.00-lnjiaj2/lib/libCling.so)

Conflicts:
	interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp
2015-03-14 03:10:54 +01:00
Philippe Canal
397921f678 Add cling::internal::SpinLockGuard 2015-03-14 03:10:53 +01:00
Pere Mato
20e2f24106 Fix for ROOT-7184 - CMake config issue when enabling cling tests 2015-03-13 18:31:50 +01:00
Axel Naumann
94dace589c Lookups can deserialize / instantiate and need Transactrions. 2015-03-10 12:02:03 +01:00
Axel Naumann
cda81151ce Fix stringify. Indentation. Version quote for standalone cling. 2015-03-06 20:15:32 +01:00
Pere Mato
61112a0f7b Changes needed to make Xcode generation working 2015-03-05 22:53:33 +01:00
Bertrand Bellenot
fbb08ff4e5 From Axel: Fix for late template parsed functions (Microsoft feature) 2015-02-26 12:29:17 +01:00
Axel Naumann
bcd1973100 Say where the .x function comes from. 2015-02-25 16:44:07 +01:00
Bertrand Bellenot
c2224aeff7 Enable asm parser in cling
Use PROJECT_SOURCE_DIR (full path to the root of the project source directory) instead of CMAKE_SOURCE_DIR (the directory from which cmake was started) in order to properly find AsmParser/CMakeLists.txt and call llvm::InitializeNativeTargetAsmParser();
2015-02-25 11:21:31 +01:00
Axel Naumann
9729c6b1f6 Use LLVM_ON_WIN32 instead of WIN32 CPP macro. 2015-02-23 00:31:28 +01:00
Axel Naumann
99a5488e9f Check that the pointer is valid before printing (ROOT-7095). 2015-02-23 00:03:26 +01:00
Axel Naumann
faf2b44a0d Tell which language is enabled (ROOT-7090). 2015-02-21 23:15:27 +01:00
Axel Naumann
e582b93a16 No #include <new> in C mode; add basic C mode test (ROOT-7090). 2015-02-21 22:43:36 +01:00
Axel Naumann
69234ce153 Fix nullptr value printing (ROOT-7092). 2015-02-21 22:27:26 +01:00