Commit Graph

1182 Commits

Author SHA1 Message Date
CristinaCristescu
8d88a849be Print the macro in .compareState. 2013-11-25 13:56:01 +01:00
CristinaCristescu
0490caaa99 Macro recovery 2013-11-25 13:56:00 +01:00
Philippe Canal
9d4823f471 Prevent function from being return as a data members.
FunctionDecl are ValueDecl and are found by lookup.
2013-11-22 20:15:59 +01:00
Axel Naumann
6e4f9cc679 From Vassil and me: move RAII out of ParseWithShortcuts().
The RAII destructs TemplateIdAnnotations that are still needed by the caller, as pointed out by valgrind:
==4595== Invalid read of size 4
==4595==    at 0x1C88E9A: clang::Sema::DecomposeUnqualifiedId(clang::UnqualifiedId const&, clang::TemplateArgumentListInfo&, clang::DeclarationNameInfo&, clang::TemplateArgumentListInfo const*&) (SemaExpr.cpp:1635)
==4595==    by 0x147FF03: clang::FunctionDecl const* cling::findFunction<clang::FunctionDecl const*>(clang::DeclContext*, clang::CXXScopeSpec&, llvm::StringRef, llvm::SmallVector<clang::Expr*, 4u> const&, bool, clang::ASTContext&, clang::Parser&, clang::Sema&, clang::FunctionDecl const* (*)(clang::DeclContext*, bool, llvm::SmallVector<clang::Expr*, 4u> const&, clang::LookupResult&, clang::DeclarationNameInfo&, clang::TemplateArgumentListInfo const*, clang::ASTContext&, clang::Parser&, clang::Sema&)) (LookupHelper.cpp:819)
==4595==    by 0x147DE1A: cling::LookupHelper::findFunctionArgs(clang::Decl const*, llvm::StringRef, llvm::StringRef, bool) const (LookupHelper.cpp:1374)
==4595==  Address 0x8013e74 is 68 bytes inside a block of size 136 free'd
==4595==    at 0x402B77D: free (vg_replace_malloc.c:468)
==4595==    by 0x1484A11: clang::TemplateIdAnnotation::Destroy() (ParsedTemplate.h:205)
==4595==    by 0x1484979: clang::DestroyTemplateIdAnnotationsRAIIObj::~DestroyTemplateIdAnnotationsRAIIObj() (RAIIObjectsForParser.h:446)
==4595==    by 0x1484914: clang::DestroyTemplateIdAnnotationsRAIIObj::~DestroyTemplateIdAnnotationsRAIIObj() (RAIIObjectsForParser.h:442)
==4595==    by 0x14848F8: cling::ParserStateRAII::~ParserStateRAII() (LookupHelper.cpp:67)
==4595==    by 0x147F284: cling::ParserStateRAII::~ParserStateRAII() (LookupHelper.cpp:54)
==4595==    by 0x147EDB1: cling::ParseWithShortcuts(clang::DeclContext*, clang::CXXScopeSpec&, llvm::StringRef, clang::Parser&, clang::Sema&, clang::UnqualifiedId&) (LookupHelper.cpp:765)
==4595==    by 0x147FE5A: clang::FunctionDecl const* cling::findFunction<clang::FunctionDecl const*>(clang::DeclContext*, clang::CXXScopeSpec&, llvm::StringRef, llvm::SmallVector<clang::Expr*, 4u> const&, bool, clang::ASTContext&, clang::Parser&, clang::Sema&, clang::FunctionDecl const* (*)(clang::DeclContext*, bool, llvm::SmallVector<clang::Expr*, 4u> const&, clang::LookupResult&, clang::DeclarationNameInfo&, clang::TemplateArgumentListInfo const*, clang::ASTContext&, clang::Parser&, clang::Sema&)) (LookupHelper.cpp:801)
==4595==    by 0x147DE1A: cling::LookupHelper::findFunctionArgs(clang::Decl const*, llvm::StringRef, llvm::StringRef, bool) const (LookupHelper.cpp:1374)
2013-11-22 16:24:55 +01:00
Vassil Vassilev
4e19547a50 The static consts end up in the lib's datasection, we need to force generation of the symbol. 2013-11-22 09:27:05 +01:00
Vassil Vassilev
82bd4d7952 Blanks 2013-11-22 09:27:05 +01:00
Philippe Canal
bf982c59e4 Avoid reading past the end of a static buffer.
llvm::sys::fs::identify_magic takes a StringRef which
was automatically created from a the char[1024] buffer.
To create the StringRef automatically requires a call to
strlen but in this case the buffer is by definition not
null terminated.  We could either null terminate or better
yet just construct explicit the 'right' StringRef.
2013-11-21 18:11:02 +01:00
Philippe Canal
0476b4d4dc Move '-Wno-ambiguous-member-template' from cling to CallFunc 2013-11-20 21:40:00 +01:00
Vassil Vassilev
55d86852f8 Suppress diagnostics in the new lookups. The code should be *really* better. 2013-11-20 17:32:09 +01:00
Philippe Canal
ca1b4775d4 Disable Wambiguous-member-template.
In CallFunc we currently always (intentionally and somewhat necessarily)
always fully specify member function template, however this can lead to
an ambiguity with a class template.  For example in
roottest/cling/functionTemplate we get:

  input_line_171:3:15: warning: lookup of 'set' in member access expression is ambiguous; using member of 't'
        ((t*)obj)->set<int>(*(int*)args[0]);
                   ^
  /local2/pcanal/cint_working/rootcling/root/roottest/cling/functionTemplate/t.h:19:9: note: lookup in the object type 't' refers here
        void set(T targ) {
             ^
  /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/stl_set.h:87:11: note: lookup from the current scope refers here
         class set
               ^
  This is an intention warning implemented in clang, see
  http://llvm.org/viewvc/llvm-project?view=revision&revision=105518

This fixes a failure in pythoncintrun in roottest/cling/functionTemplate.
2013-11-20 15:07:57 +01:00
Axel Naumann
67c0c9c344 From Bertrand: also find libs in ./ 2013-11-20 09:48:56 +01:00
Vassil Vassilev
f35b70cc1a When the initializer is trivially foldable we must not ignore emission. 2013-11-20 09:31:02 +01:00
Philippe Canal
3daaffb035 Add missing header 2013-11-19 05:33:55 +01:00
Philippe Canal
c423ae3bc8 Add LookupHelper::findDataMember to retrive a field or variable. 2013-11-19 04:37:11 +01:00
Vassil Vassilev
dfcb11ad0b Document a parameter. 2013-11-15 16:10:02 +01:00
Vassil Vassilev
13eac71d67 Add clarification comment showing the inheritance. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
6d1f7841ef Accumulate the success stories. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
2fd195e375 Before removing the namespace update the lookup with the new original namespace. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
7faa716e57 When we remove a redeclarable make sure we update the lookup.
When we remove the decl part of a redelarable chain registered in the lookup
tables we need to update them by putting the new head (or a valid decl) from
the new redecl chain.

Correct the remove order.
2013-11-14 15:24:03 +01:00
Vassil Vassilev
81f430dd85 Cleanup the hash table keys even the entries were 0. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
cb713d743f Merge the conflicts. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
d70c1702dc Ignore the noise coming from the lazily-created builtins. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
31534f1f79 Add prefix making rm cling* easier. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
3f7fcc82ad Dump the lookup tables, too. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
b600182114 Typo. 2013-11-14 15:24:03 +01:00
Vassil Vassilev
7a4fcf39ed Make sure we call the dtor for the state object. 2013-11-14 15:24:02 +01:00
Philippe Canal
388271f9e9 Add cling::LookupHelper::findFunctionTemplate
Given a context and a name (and a constness), return the corresponding
function template decl.
2013-11-13 19:46:00 +01:00
Philippe Canal
e0e2df65e5 Allow findAnyFunction to discover a template instance without any argument hints
This allows to find an existing function template instance even based on only
the template name (of course, in this case, no instantiation is done, only already
existing ones can be returned).

This allows add there same features to TListOfFunctions::FindObject and
TViewAllPublicFunctions::FindObject.
2013-11-13 19:45:59 +01:00
Vassil Vassilev
77c8f50434 Add parenthesis. 2013-11-13 11:56:00 +01:00
Bertrand Bellenot
c5ef063462 Another attempt to fix a buffer overflow error on ubuntu (optimized mode only, making it hard to debug...) 2013-11-12 17:38:55 +01:00
Vassil Vassilev
53cea811f6 Assert only on valid decls. 2013-11-12 11:15:55 +01:00
Bertrand Bellenot
3c9b31be34 Use set_size so make sure the llvm::SmallString is not empty 2013-11-12 09:58:56 +01:00
Bertrand Bellenot
0f9145a1ae Revert previous changes and make sure the llvm::SmallString is not empty 2013-11-12 09:13:00 +01:00
Bertrand Bellenot
031f8be452 Use a llvm::SmallString instead of a char[] to avoid corrupting the stack (thanks Axel) 2013-11-11 20:40:10 +01:00
Vassil Vassilev
3230cbf347 Reset the diagnostics in the decl reverter. 2013-11-11 17:27:57 +01:00
Vassil Vassilev
8760a8e7c7 Simplify and disable assert until the issue is clear. 2013-11-11 17:27:57 +01:00
Vassil Vassilev
988ce2c9a8 Fix valgrind failure. Don't try to remove a decl twice. 2013-11-11 17:27:57 +01:00
Bertrand Bellenot
738d8cb72c Fix compiler warning
Fix compiler warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result
And issue a warning if the canonical path cannot be obtained
2013-11-11 16:11:00 +01:00
Bertrand Bellenot
6e5d2f5a50 Fix compiler warning: unused variable ‘res’ 2013-11-11 15:15:59 +01:00
Bertrand Bellenot
d9f80eb51b Use canonicalized absolute pathname
This should fix Jira #ROOT-5636 Be more precise on whether a shared library was loaded
2013-11-11 12:19:59 +01:00
Axel Naumann
30d28d311d Remove misplaced and duplicate comment. 2013-11-08 17:26:55 +01:00
Axel Naumann
5d5c0cf0f0 Fix doc. 2013-11-07 11:28:58 +01:00
Axel Naumann
aebbf7f0dc Spelling. 2013-11-07 11:28:57 +01:00
Philippe Canal
baebf42627 Add comment clarifying ROOT-4602 2013-11-06 21:39:56 +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
1b8795f0c3 In findFunction*, add template instantiation if needed.
Update the test accordingly.
2013-11-04 14:35:07 +01:00
Philippe Canal
66d3abc12c Add instantiation (if needed) to findAnyFunction 2013-11-04 14:35:06 +01:00
Philippe Canal
0adde75bd2 In findAnyFunction, properly handle the template case.
As the other findFunction*, findAnyFunction does not
(yet?) instantiate the function template if has not
yet been instantiated.

Also add test for findAnyFunction.
2013-11-04 14:35:06 +01:00
Philippe Canal
6f87119b4b Add LookupHelper::findAnyFunction 2013-11-02 13:55:02 +01:00
Philippe Canal
abdb935f70 typo 2013-11-02 13:55:01 +01:00