1502 Commits

Author SHA1 Message Date
Vassil Vassilev
6924828aec Handle ClassTemplateSpecializations. 2014-02-10 11:20:58 +01:00
Vassil Vassilev
f201444ef8 Handle the specializations before anything else. 'Typo' &= instead =. 2014-02-10 11:20:58 +01:00
Vassil Vassilev
203c679933 Handle the specializations before anything else. 2014-02-10 11:20:58 +01:00
Vassil Vassilev
b571a01462 Clarification. 2014-02-10 11:20:58 +01:00
Vassil Vassilev
409b06ae0b It appears that injected class names can be before or after the definition in the chain.
Handle both cases.
2014-02-10 11:20:58 +01:00
Vassil Vassilev
0aa6faa4aa Tags are redeclarables. 2014-02-10 11:20:57 +01:00
Vassil Vassilev
6d792cfb00 Docs. 2014-02-10 11:20:57 +01:00
Vassil Vassilev
fa9fe845cd RecordDecls are special. They have implicitly injected class names.
struct C {
   // C is implicitly declared here as a synonym for the class name.
};

C::C c; // same as "C c;"

In this example clang will inject another declaration to provide the name C
within the record decl. For unknown reason it is added to the redecl chain.
When we revert a class decl we must make sure that the implicitly injected name
in the chain is gone.
2014-02-10 11:20:57 +01:00
Vassil Vassilev
8b4b340f6e Add support for typedefs, because they are redeclarables. 2014-02-10 11:20:57 +01:00
Vassil Vassilev
aca1966b77 Assert immediately after failure. 2014-02-10 11:20:57 +01:00
Vassil Vassilev
02757c1176 Add missing enum kind for the dump. 2014-02-10 11:20:57 +01:00
Vassil Vassilev
f89238364e The dump comes from a map, i.e it is unordered which is a killer for diff
Alphabetically sort the macro dumps and them print them out and compare them.
2014-02-10 11:20:56 +01:00
Vassil Vassilev
2501b1c8b5 Remove redundant const. 2014-02-10 11:20:56 +01:00
Vassil Vassilev
c5aee224bd Bring back macro removal (Sorry Cristina). 2014-02-10 11:20:56 +01:00
Vassil Vassilev
4b10109210 The NamespaceDecl is a redeclarable. Don't do extra lookup fixes 2014-02-10 11:20:56 +01:00
Vassil Vassilev
75a65da546 We need the full redecl chain when reverting the function parameters. 2014-02-10 11:20:55 +01:00
Vassil Vassilev
a72f5bda26 Parameters and dependent variables don't end up mangled in the llvm::Module 2014-02-10 11:20:55 +01:00
Vassil Vassilev
a452cde4a5 Workaround to advance... A decl meant to be added in the lookup already exists in the lookup table. My assumption is that the DeclReverted adds it here. This needs to be investigated mode. For now std::find gets promoted from assert to condition 2014-02-10 11:20:55 +01:00
Vassil Vassilev
6d6abaa159 Revert UsingShadowDecls. 2014-02-10 11:20:55 +01:00
Vassil Vassilev
5933b67862 Improve debugging look and feel. 2014-02-10 11:20:55 +01:00
Vassil Vassilev
fccc2a0551 Sanity check for duplicate lookup entries. 2014-02-10 11:20:55 +01:00
Axel Naumann
759a79ea22 Do not include -I in cling-compiledata.h (ROOT-6048). 2014-02-10 11:00:58 +01:00
Axel Naumann
2324d15772 Fix typo in arry idx (ROOT-6056). 2014-02-10 09:52:28 +01:00
Bertrand Bellenot
571e739524 Fix a potential crash when there is a line longer than the terminal width (taking two or more lines to display) in the history (using up arrow key) in a ROOT session while the terminal's buffer is full 2014-02-10 09:52:28 +01:00
CristinaCristescu
091a2aabaf Add correct test for unanamed decls for cling. 2014-02-07 23:12:58 +01:00
CristinaCristescu
aadc2db22c Add test for unnamed decls for cling. 2014-02-07 23:12:58 +01:00
CristinaCristescu
d4802dce48 Do not create TEnums nor add them to the list of enums for unnamed enums + Vasil fix for unnamed typedef decl. 2014-02-07 23:12:57 +01:00
Axel Naumann
c36da12a79 Disable history if envvar CLING_NOHISTORY is set - for fixed memory address. 2014-02-06 17:40:54 +01:00
Vassil Vassilev
2c2ada407e XFAIL clang's testsuite for now. 2014-02-06 14:57:52 +01:00
Vassil Vassilev
aa77258c9c Fix iterators.
Two things first the iterator wasn't considered to be empty.
Second the loop written such assumes chances to the collection
within the loop which is not the case.
2014-02-06 14:51:00 +01:00
Vassil Vassilev
698c8f16fc Fix windows warnings. 2014-02-06 14:51:00 +01:00
Vassil Vassilev
ec226ced77 Get rid of removeIfLast. 2014-02-06 14:51:00 +01:00
Vassil Vassilev
b73270a1ab Add handling for FunctionTemplateDecl-s and ClassTempalateDecls.
After the update of removeIfLast, they fall into the 'ordinary' cases.
2014-02-06 14:50:59 +01:00
Vassil Vassilev
11fca7fdc9 If the lookup vector doesn't contain decls remove the entry from the map.
The lookup table is highly optimized: a single data member can be a single decl
or a vector with decls. In the regular case when clang only adds declarations
the single decl gets promoted to a vector.

The decl reverter doesn't bother to demote the vector into a single decl (for now)
Insted if we see the vector is empty we remove the lookup entry from the map and
thus we make the compareState happy.
2014-02-06 14:50:59 +01:00
Vassil Vassilev
06453363fc Simplify the removeIfLast. This soon will disappear.
In the past we used that routine as sanity check whether we are reverting in
the correct order. Now we have store/compare state.

Moreover this is wrong because the the template specializations create a mess
in the order, because the pattern is being added to the context but not the
underlying declarations. This breaks the logic of the visitor as it needs to have
two completely different code paths for templates and the rest of the decls only
because we wanted to keep this logic.

Now is a lot simpler. Remove the decl if it was in the context, without providing
any sanity checks what so ever.
2014-02-06 14:50:59 +01:00
Vassil Vassilev
208134db39 Simplify the update of the lookup tables when visiting a redeclarable.
The key idea is that the decl that is being detached from the redecl chain can
be in registered in the lookup tables. In this case we need to check if there
is another decl in the chain and update the lookup table so that the existing
decls in the chain could be accessible.
2014-02-06 14:50:59 +01:00
Vassil Vassilev
a0f98889ec Style. 2014-02-06 14:50:59 +01:00
Vassil Vassilev
365425ef87 Move template handling functions in a separate 'section' 2014-02-06 14:50:59 +01:00
Vassil Vassilev
438cac52ed FunctionTemplateDecls don't get registered in the lookup. They have templated decls which are the ones that need to be reverted. 2014-02-06 14:50:58 +01:00
Vassil Vassilev
0055f5b14e Adjust to the test with the correct vars. 2014-02-06 14:50:58 +01:00
Vassil Vassilev
0fec137d95 Add a test that loads every clang test and unloads it 2014-02-06 14:50:58 +01:00
Vassil Vassilev
2b0da458d9 Test improvement of the lookup
(should be ignored)
2014-02-06 14:50:58 +01:00
Vassil Vassilev
7763150743 Keep the files diff files until the end of the session 2014-02-06 14:50:58 +01:00
Vassil Vassilev
6a73a2bf66 Prepend cling prefix, which makes the file deletion easier. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
938326566e Blanks. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
3a13198242 Blanks. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
13021e652b In rawInput mode we want to be as close as possible to the compiler. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
968528bbb4 Allow the unloading even in -fsyntax-only mode. At least for verification purposes it is very useful. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
e5a0df500e Add support for C tentative definitions. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
17387d8db0 Blanks. 2014-02-06 14:50:56 +01:00