2354 Commits

Author SHA1 Message Date
Philippe Canal
08a86e35eb Add support for fully qualifying a template argument that is itself a template.
This is the case for example with gcc's

  __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool,true>

where __pool is actually a class template.

Also reduce (a little bit) code duplication.
2014-09-17 21:33:02 +02:00
Vassil Vassilev
49d8e02b27 Pass in the printing policy when printing types. 2014-09-15 14:12:07 +02:00
Vassil Vassilev
dba2f39ff4 Print only annotate attr until type_visibility printing is fixed. 2014-09-15 14:12:06 +02: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
2aacd83287 Introduce Lookup::Named overload taking a StringRef 2014-09-15 12:26:13 +02:00
Axel Naumann
c4ad2ff154 Use fully qualified template args. 2014-09-14 13:53:11 +02:00
Axel Naumann
3b078ed887 No need to be more const correct than getCI()->getSema()! 2014-09-14 13:53:10 +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
Axel Naumann
e74ae3cf0f Disable default cling-autoload callback (diag) for now.
The only real current user - ROOT - cannot make use of the diagnostics.
Instead the default callback should probably only be invoked if none of
the other, multiplexed handlers returns true.
2014-09-14 13:53:09 +02:00
Axel Naumann
b7a590c40e Pass StringRef-s instead of copying strings... 2014-09-14 13:53:09 +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
Philippe Canal
91e924b262 Delay call to PrepareParsing until really needed 2014-09-12 05:16:06 +02:00
Philippe Canal
8592056883 Remove unnecessary parsing preparation 2014-09-12 05:16:05 +02:00
Philippe Canal
8c8e99618f move comments around 2014-09-12 05:16:05 +02:00
Philippe Canal
ead917ecc8 Factor out some more of the 'findFunction' code 2014-09-12 05:16:05 +02:00
Philippe Canal
b8e57bce99 Fix cling tear down crash involving the ExternalSemaSource.
With the unique_ptr, we were crash due to the held over reference described
below.  Trying to move the m_ExternalSemaSource deletion after the m_IncrParser
deletion also leads to crash due to the double deletion (once by the ASTContext,
once by m_ExternalSemaSource) of the ExternalSemaSource.

If m_Callbacks is declared after m_IncrParser, it will be deleted first
and if m_ExternalSemaSource is a unique_ptr, it willbe deleted before
m_IncrParser is delete.

During the Incremental parser deletion, there is a call to
CodeGenModule::Release, then EmitTargetMetdata is called and it tries to
get the most recent decl which calls
     clang::LazyGenerationalUpdatePtr<...>::get
which has a LazyVal which has a cached pointer to the AST external
source.  So this placement is necessary to solve a tear down crash.

#0  clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428
428	        (LazyVal->ExternalSource->*Update)(O);
(gdb) l
423	  /// Get the value of this pointer, updating its owner if necessary.
424	  T get(Owner O) {
425	    if (LazyData *LazyVal = Value.template dyn_cast<LazyData*>()) {
426	      if (LazyVal->LastGeneration != LazyVal->ExternalSource->getGeneration()) {
427	        LazyVal->LastGeneration = LazyVal->ExternalSource->getGeneration();
428	        (LazyVal->ExternalSource->*Update)(O);
429	      }
430	      return LazyVal->LastValue;
431	    }
432	    return Value.template get<T>();

#0  clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428
#1  0x000000010005ce38 in clang::Redeclarable<clang::FunctionDecl>::DeclLink::getNext (this=0x1069c3ff0, D=0x1069c3f90) at Redeclarable.h:74
#2  0x000000010005cd81 in clang::Redeclarable<clang::FunctionDecl>::getNextRedeclaration (this=0x1069c3ff0) at Redeclarable.h:119
#3  0x000000010005d0b3 in clang::Redeclarable<clang::FunctionDecl>::getMostRecentDecl (this=0x1069c3ff0) at Redeclarable.h:161
#4  0x000000010137bfdc in clang::FunctionDecl::getMostRecentDeclImpl (this=0x1069c3f90) at Decl.h:1568
#5  0x00000001004b5346 in clang::Decl::getMostRecentDecl (this=0x1069c3f90) at DeclBase.h:806
#6  0x0000000100897128 in clang::CodeGen::CodeGenModule::EmitTargetMetadata (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3271
#7  0x0000000100895237 in clang::CodeGen::CodeGenModule::Release (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:395
#8  0x0000000100981b3c in clang::CodeGeneratorImpl::ReleaseModule (this=0x106506d70) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/ModuleBuilder.cpp:82
#9  0x00000001001c3f88 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:168
#10 0x00000001001c3f25 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:166
#11 0x00000001001d8905 in std::__1::default_delete<cling::IncrementalParser>::operator() () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2426
#12 0x00000001001d8905 in ~unique_ptr [inlined] () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2625
#13 0x00000001001d8905 in ~Interpreter (this=0x7fff5fbff020) at memory:2593
#14 0x00000001001d8355 in ~Interpreter (this=0x7fff5fbff020) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/Interpreter.cpp:229
#15 0x00000001002b0318 in main (argc=1, argv=0x7fff5fbff740) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/tools/driver/cling.cpp:97
2014-09-11 23:24:02 +02:00
Pere Mato
1330543641 Avoid copying or creating soft link of cling under llvm/src/tools. This solved the problem of soft links on Windows. 2014-09-04 17:49:17 +02:00
Vassil Vassilev
c0321e417e Test passes. 2014-09-04 11:03:05 +02:00
Vassil Vassilev
d303a43760 Add expected warning. 2014-09-03 12:03:03 +02:00
Vassil Vassilev
7887676b92 Remove the member, we inherit it. 2014-09-03 12:03:03 +02:00
Vassil Vassilev
9b28750656 Inline ctor. 2014-09-03 12:03:03 +02:00
Philippe Canal
e4c0a20450 Reduce unnucessary type recreation 2014-09-02 23:01:15 +02:00
Vassil Vassilev
a67f06645e operator() doesn't have a name. 2014-08-29 15:31:05 +02:00
Vassil Vassilev
fcf3e37af8 Check if the AST reader is attached and if so attach also our listener. 2014-08-23 19:10:02 +02:00
Vassil Vassilev
9df81a3156 Pass in correct llvmdir to the nested instance. 2014-08-23 15:44:07 +02:00
Vassil Vassilev
1a1ba21102 Remove comment, the maybe was implemented. 2014-08-23 15:44:07 +02:00
Vassil Vassilev
ddea45dbac If there are no listeners then attach one. 2014-08-23 15:26:04 +02:00
Vassil Vassilev
00ed79b4e8 AutoloadCallback doesn't need to use listeners. 2014-08-23 15:26:04 +02:00
Vassil Vassilev
7f6ff73f3c Make SetIsRuntime virtual so that the multiplexer can notify. 2014-08-23 15:26:04 +02:00
Vassil Vassilev
efa445eb72 Reenable test. 2014-08-23 15:05:01 +02:00
Vassil Vassilev
6b8ad490e5 Remove redundant vars. Silence warnings. 2014-08-23 14:36:04 +02:00
Vassil Vassilev
eedd68b42d Default to /dev/null 2014-08-22 15:23:06 +02:00
Vassil Vassilev
a3c0db36da Pass the SourceManager in. Handle cases where the parsing happens outside the current interpreter instance. 2014-08-22 15:23:06 +02:00
Vassil Vassilev
13167385c2 Silence an error and add a fixme. 2014-08-22 15:23:05 +02:00
Vassil Vassilev
a5ca0da4bc No extra flags in the ctor. 2014-08-22 09:19:21 +02:00
Vassil Vassilev
a59cd2bb81 Silence a warning. 2014-08-22 09:19:21 +02:00
Vassil Vassilev
eda6bc1949 Improve and reenable test. 2014-08-21 17:26:02 +02:00
Vassil Vassilev
afb476270a Enable autoloading callback.
This callback works in sync with the forward declaration autoloading maps. I.e
we produce a forward declaration map file. However for certain forward declarations
we need for example to put the default arguments. For instance function declarations
need default arguments, and it would be sufficient to make a library call.

However the problem is when the actual definitions come and try to merge with
the forward declarations. In the function decls case, the compiler naturally will
issue an error because C++ doesn't allow two declarations to define the default
arguments. The same holds for template classes (of course following a lot more
 complex semantics). This callback monitors if a file with the original file
(whose forward decls were registered) is being #included and strips all the
default arguments so that the following pattern is compilable:
2014-08-21 17:07:03 +02:00
Vassil Vassilev
f46897c2e6 Move the ownership stealer in the implementation. 2014-08-21 17:07:03 +02:00
Vassil Vassilev
9c3102a2cc Add override keyword for sanity control. 2014-08-21 17:07:03 +02:00
Vassil Vassilev
9ec9b36a4a File can become 0 if #include-ing non-existant file. 2014-08-21 17:07:03 +02:00
Vassil Vassilev
b538604dc0 Remove the non-working implementation of multiplexing callback. 2014-08-21 17:07:02 +02:00
Vassil Vassilev
0246d5f0b0 Move the multiplexing callbacks in lib. Simplify. 2014-08-21 17:07:02 +02:00
Vassil Vassilev
f4c946a68d AnnotateAttr::setAnnotation needs the decl of operator new. 2014-08-21 17:07:02 +02:00
Vassil Vassilev
46d3344ca0 Add constness. 2014-08-21 17:07:02 +02:00
manasij7479
04b8928a3f Bypass short circuit evaluation 2014-08-21 17:07:02 +02:00
manasij7479
70f01ae5ed MultiplexInterpreterCallbacks 2014-08-21 17:07:02 +02:00