1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Commit graph

12355 commits

Author SHA1 Message Date
Sergey Prigogin
1a4e509e0d Bug 423471 - ClassCastException in CPPASTTemplateIDAmbiguity 2013-12-06 11:38:43 -08:00
Sergey Prigogin
aa9dd95996 Cosmetics. 2013-12-06 11:28:24 -08:00
Sergey Prigogin
ff49775235 Bug 400073 - More robust clearing of results cache. 2013-12-06 11:16:59 -08:00
Sergey Prigogin
3fbe0d12af Bug 400073 - Indexer runs out of memory.
Fixed a soft memory leak caused by accumulation of data in
PDOM.fResultCache when several consecutive files fail to parse.
2013-12-05 20:40:15 -08:00
Sergey Prigogin
2668018f30 Fixed a warning in Codan. 2013-12-05 18:25:04 -08:00
Andrew Eidsness
4dab99404c Bug 422681: Load the correct binding for cross-linkage references
The test case in the previous commit was invalid.  The test case did not
modify the binding that was referenced by the name and it was checking
for the wrong binding after reading the reference from the Database.
Further, the test case had a hole where the type of binding that was
being used happens to have same node type in both the C and C++
linkages.

I've fixed the test case as follows:

1) The test type is now an enum which has a different nodeType in the C
and C++ linkages.  The test case will now be able to catch cases where
the wrong linkage is used when reading the binding.

2) The test case now changes the name to reference a binding in a
different linkage.  This means the later code (in the test case) is
expected to actually load a binding from a different linkage.

3) The test case now checks that the loaded binding really did come from
the other linkage.  The previous implementation of the test case was
using the wrong binding for the checks.

I've also updated the implementation so that the updated test case
passes.

As an aside, during this update we (Doug and I) noticed that PDOMNames
unnecessarily store a PDOMLinkage.  Bindings come from languages, and
therefore need a PDOMLinkage (so that the proper type can be loaded).
Names reference bindings and therefore should not have a linkage.  The
motivating example is that there should be one binding for the printf
function, but it could be referenced using names that are created by
different parsers.  This can be fixed in a later change.

The major change to implementation is that PDOMNode now stores an
identifier for the factory to use when loading the node.  PDOMNode was
already using an int to store the nodeType.  I've split this to store
the factoryId as a short and the nodeType as a short.  The highest
nodeType currently in use is 58 -- a short should provide ample room for
expansion.

Since PDOMNode is now able to pick the proper factory for loading, we no
longer need the PDOMLinkage.getNode(long) method and I've marked it
deprecated.  Instead there is a new method PDOMNode.load(PDOM, long).
Nodes read their factoryId from the database, so the PDOMLinkage is not
needed.

Later commits should cleanup the following:

    a) Remove PDOMLinkage from PDOMNode (and related)
    b) Change return type of PDOMNode.getNodeType to short
    c) Replace deprecated calls to PDOMLinkage.getNode

Among these changes, (a) should allow removal of the external references
list.  If names can be loaded without a linkage, then there would be no
reason to store the linkage when storing the name.

Change-Id: Ife2b21cb21ed1ac6d6c361d0ffb8c7434832c79c
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19377
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-05 13:39:03 -05:00
Sergey Prigogin
424c2898fe Bug 423127 - Template resolution gets confused by "void" in a parameter
list

Change-Id: I6d2510ce7f1c8007da7121855bc4870e4a57d15d
Reviewed-on: https://git.eclipse.org/r/19355
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2013-12-05 00:54:07 -05:00
Sergey Prigogin
ff8baa2754 Cosmetics. 2013-12-04 19:46:34 -08:00
Sergey Prigogin
5adfb67a9d Added toString method. 2013-12-03 18:18:50 -08:00
Sergey Prigogin
772f6c1643 Bug 423126 - Extract Function refactoring misses additional occurrences
of the extracted code
2013-12-03 18:16:43 -08:00
Sergey Prigogin
090345f405 Cosmetics. 2013-12-03 18:05:48 -08:00
Sergey Prigogin
bd0e88a3e2 Code streamlining. 2013-12-03 17:31:52 -08:00
Sergey Prigogin
3a7a88486b Cosmetics. 2013-12-03 17:29:36 -08:00
Marc-Andre Laperle
0071f546d1 Bug 418770 - NPE in EvalBinding.getBinding involving specialized enum
Change-Id: Ibbf3c1dd40e3e33a111c5d3a433277a1349dd445
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/19031
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2013-12-02 09:52:45 -05:00
Sergey Prigogin
8852f2d73e Cosmetics. 2013-11-30 23:10:58 -08:00
Sergey Prigogin
772066afce Bug 422727 - Extract Function doesn't properly handle auto types 2013-11-30 22:39:34 -08:00
Sergey Prigogin
eb421c9fec Removed public visibility from DialogMessages class. Externalized
strings were never intended to be a part of the public API.
2013-11-30 22:34:35 -08:00
Sergey Prigogin
a9f9839cc9 Added @noreference tag to logging methods. 2013-11-30 22:14:14 -08:00
Sergey Prigogin
c9909363f9 Cosmetics. 2013-11-30 22:09:42 -08:00
Andrew Eidsness
fccbec7b0d Bug 422841: Initial implementation of QtIndex
This uses the new PDOMASTProcessor extension point to create a
Qt-specifc PDOMLinkage.  This initial version of the linkage only stores
QObjects and their base classes.  Later commits will fill out other
details and introduce classes that use this data for things like Content
Assistance and Codan checking.

This patch introduces the following:

1) QtIndex: This is an index that provides access to Qt-specific data.
The index is mostly a wrapper on the CDT's existing IIndex, but it
provides very specific information about the Qt elements.  The only data
that can be accessed from the QtIndex (in this patch) is a QObject and
the QObject's that appear in its base class specifier list.

2) QtPDOMLinkage: This linkage is implemenated as an extension of the
PDOMCPPLinkage.  In some cases it adds references to Qt names from the
C++ bindings.

3) Test suite: The test suite has some base classes for parsing the Qt
source code.  The only test case is for the simple functionality that is
being added in this patch -- examining the base class specifier list of
QObjects.

These areas will be extended in later patches.

Change-Id: I13fb83beb7f50cd2efb1de97b562245dc642468d
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19113
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-29 14:43:41 -05:00
Andrew Eidsness
5e130ab883 Bug 422804: Allow contributors to add data to the PDOM
The CDT persists an index of source code relationships by processing the
AST produced by the parser.  There is an existing extension-point that
allows contributors to create new linkages in this persisted file.
However there is no mechanism allowing contributors to influence the
data that is stored to the file.

This introduces a new extension-point allowing contributors to
participate in processing the AST that is being persisted to the index.
The intent is for this to be used to store data into the contributor's
new Linkage.

There is no change in functionality for existing linkages.  A
contributor will soon be added in the Qt plugin.

Change-Id: I845c90cbf7c713e23319e2ed1168eb7d74db5868
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19089
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-29 00:27:15 -05:00
Andrew Eidsness
08c7d10763 Bug 422765: New method to find IBindings from qualifiedName
This creates a new method in CPPSemantics that will lookup a list of
IBindings from a qualifiedName.  E.g., given:

    namespace A
    {
        namespace B
        {
            int b;
        }
    }

CPPSemantics.findBindingsByQualifiedName(scope, "A::B::b"); will return
an array with the CPPVariable binding for b.

This commit contains a new test case for various cases that I've thought
about.  I had expected that by using the existing lookup functions (in
CPPSemantics) I wouldn't have to think too hard about various matches.
However, the existing functions didn't work quite the way that I
expected.

Change-Id: I8a5aacba4a02d87f71ed4698aa432c3161395a31
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19067
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-28 23:37:18 -05:00
Andrew Eidsness
f887c8e671 Bug 422681: Allow references to bindings in other linkages
The existing PDOMBinding and PDOMName implementations do not allow
references between linkages.  This feature is needed so that the new Qt
linkage can reference elements in the C++ linkage.  It will also allow
the C++ implementation for extern "C" to be cleaned up (see
PDOM.getCrossLanguageBindings).

Prior to this change, a PDOMBinding held three lists of names.  One for
each of declarations, definitions, and references.  This change adds a
fourth list for external references.  External references are stored as
a linked list of nodes.  Each node holds:

    - The linkage id.
    - A pointer to the next node (or 0 for end-of-list).
    - A pointer to the record of first name in the list.

The linkage id is held separately because a PDOMName does not have any
field of it's own for linkage.  By grouping elements in this way, we can
reuse most of the existing list-related code.

External references are accessed through a new PDOMIterator class.  This
is needed so that we can advance to the next linkage node when we get to
the end of one node's list of names.

This also adds a unit test for the new API.

Change-Id: Ie2b14848db7409905beda0cec752080d5f42eec8
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/18979
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-27 19:56:03 -05:00
Sergey Prigogin
a205557db0 Cosmetics. 2013-11-27 16:25:07 -08:00
Sergey Prigogin
a45fabad98 Bug 422700 - Name resolution problem with variadic template. 2013-11-27 16:21:54 -08:00
Sergey Prigogin
853af1574b Cosmetics. 2013-11-27 16:20:35 -08:00
Sergey Prigogin
02001dbe71 Bug 422695. More test cases and fixes. 2013-11-27 14:27:00 -08:00
Sergey Prigogin
2f38016b98 Cosmetics. 2013-11-27 12:25:33 -08:00
Sergey Prigogin
e9e53fb9fa Bug 422695 - Organize Includes does not add include for template
parameter of unique_ptr, etc.
2013-11-27 09:42:55 -08:00
Sergey Prigogin
38fd6392e2 Cosmetics. 2013-11-25 19:48:46 -08:00
Sergey Prigogin
2d58772f73 Bug 421247 - ASTNode.copy() chaining inconsistent
Change-Id: I89397209ae6a47b5a3a0827942b83a6755bc60e0
Reviewed-on: https://git.eclipse.org/r/18874
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2013-11-25 21:37:10 -05:00
Sergey Prigogin
4f485bfd58 Bug 422217 - NPE in IndexLocationFactory.getAbsolutePath 2013-11-21 11:47:18 -08:00
Sergey Prigogin
24922585f0 Bug 421398 - Organize Includes not adds includes for base class. 2013-11-20 11:47:17 -08:00
Sergey Prigogin
6f2c349bc3 Corrected tracing code. 2013-11-19 13:47:17 -08:00
Sergey Prigogin
6aa836780c Cosmetics. 2013-11-18 19:13:47 -08:00
Marc-Andre Laperle
dfd0794ed6 Bug 421889 - Typo in CRefactoringDescriptor_unknown_project message
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2013-11-16 17:21:56 -05:00
Sergey Prigogin
33174d0697 Cosmetics. 2013-11-07 20:27:37 -08:00
Sergey Prigogin
c98b965760 Erase code_formatter preference when disabling project specific settings 2013-11-07 20:23:28 -08:00
Sergey Prigogin
e363ba7f04 Cosmetics. 2013-11-07 11:26:53 -08:00
Serge Beauchamp
3d9e51d8ae Bug 421070 - DwarfReader should scale better for large binaries
Change-Id: I9e085f7fc8e48b265d0e3aa36501e9ae3dadad91
Signed-off-by: Serge Beauchamp <sergebeauchamp@mac.com>
Reviewed-on: https://git.eclipse.org/r/18081
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2013-11-06 23:05:37 -05:00
Marc-Andre Laperle
e911482b4e Fix compilation error. 2013-10-28 22:17:43 -04:00
Sergey Prigogin
642d4c3975 A step towards unification of Organize Includes and Add Include header
substitution algorithms.
2013-10-28 16:27:08 -07:00
Sergey Prigogin
cc3695ca21 Cosmetics. 2013-10-25 09:26:03 -07:00
Serge Beauchamp
66acca58ba Bug 409916 - Can not expand Binary with DWARF 4 format, NPE in
DwardReader

Change-Id: Iaea9685051d5dd73f8504ea3714ce26198fdac46
Signed-off-by: Serge Beauchamp <sergebeauchamp@mac.com>
Reviewed-on: https://git.eclipse.org/r/17542
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
IP-Clean: Jeff Johnston <jjohnstn@redhat.com>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
2013-10-23 12:28:31 -04:00
Marc-Andre Laperle
e562b5e204 Bug 419900 - NPE in BaseClassLookup.lookupInBaseClass
Change-Id: I868bf1918a18a9e7db4aba4d2792510aea03e9a4
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/17551
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2013-10-21 23:56:20 -04:00
Sergey Prigogin
d2b9c42395 Cosmetics. 2013-10-21 17:02:40 -07:00
Sergey Prigogin
d722e6d367 Cosmetics. 2013-10-21 14:11:07 -07:00
Sergey Prigogin
20e35e3e42 Code streamlining. 2013-10-21 14:06:28 -07:00
Sergey Prigogin
1e9005bdc8 Cosmetics. 2013-10-21 14:02:13 -07:00
Sergey Prigogin
b2b2a109f5 Fixed a potential NPE. 2013-10-21 10:15:46 -07:00