1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
Commit graph

14155 commits

Author SHA1 Message Date
Jonah Graham
7b6701f9ef Bug 569839: Add DefaultCCommentAutoEditStrategyTest to testsuite
This test started failing (and wasn't in testsuite previously) because
it had significant trailing whitespace in some tests.

The fix is to use ${whitespace_eol} which I have also added to some
of the javadocs to make it easier to find next time.

Change-Id: Ib364d8a400bcdeb21445dde8428e0fd4c77db990
2020-12-21 11:49:24 -05:00
Jonah Graham
75e281ffac Bug 569839: Restore the cleanupProject
This style is the JUnit3 way of doing JUnit4 @AfterClass. It was
commented out as part of Bug 564002 (commit 9e303185f9).

Change-Id: I56e2754f3cce447c47546c91cdc16b302e18b4a6
2020-12-21 11:49:24 -05:00
Jonah Graham
f3bee99f00 Bug 569839: Don't discard exceptions in tests
Change-Id: I710922fcc1b23d61d52fa1aa868b491bc26edf01
2020-12-21 11:49:24 -05:00
Jonah Graham
cb35c8daa2 [releng] Remove unused API filters
Change-Id: I960afcd99198918fe5f86983243b571c23a3c97f
2020-12-19 13:01:44 -05:00
Jonah Graham
c248620053 [releng] Increment feature and related versions to 10.2.0
Change-Id: Icd135a588920fa25fd846dc285db5f83e5ac7037
2020-12-19 12:11:25 -05:00
Torbjörn SVENSSON
05322656c6 Bug 539927: Do not mark "Removing unused section" lines as errors
The lines are printed by the GNU ld with the flag --print-gc-secions

Change-Id: Ie09229427a29e9959f8ffe4920a1645ad3dcb086
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
2020-12-02 10:53:11 +01:00
Torbjörn SVENSSON
0f3214ace9 Bug 569353: The mode output from ld is not an error
Change-Id: I1a29bd698c3b37d687bf76a416689df0a69aa50d
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
2020-12-01 08:34:03 -05:00
Simeon Andreev
d4c6168964 Bug 486033 - Add close button to CDT Build Console toolbar
This change adds a close action
(org.eclipse.ui.console.actions.CloseConsoleAction) to the CDT build
console.

CDT accessing a closed console via BuildConsoleManager will result in
re-adding the respective console page to the console view, if the
console page was closed.

Change-Id: Ifc4d4c6ed329f1c1c7e70f7903ed660ba85306c5
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2020-11-29 15:14:40 -05:00
Simeon Andreev
a655f7b4a5 Bug 568926 - Build Console has no action to disable activation on output
This change adds an action to the CDT build console, to disable
activation on build output. The action uses the existing preference
"build console on top when building" from C/C++ -> Build -> Console.

The action icon is copied from platform debug UI, see:

org.eclipse.debug.internal.ui.IInternalDebugUIConstants.IMG_ELCL_STANDARD_OUT
org.eclipse.debug.ui/icons/full/elcl16/writeout_co.png (and @2x)

The change also ensures the existing preference works, as it currently
has no effect on not showing the build console on CDT build.

Change-Id: I0d94583b85e1a13f18d43de8c10355ccdab7f259
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2020-11-29 15:04:00 -05:00
Jonah Graham
409a830c39 Bug 568375: Consistent versions for use of JAXB libraries
Change-Id: I86a6def37aed6c30a7591fd8dde4c174f6af98bb
2020-11-19 14:31:30 -05:00
Torbjörn Svensson
e632011f2c Bug 568728: Drop execute permission on files
Add enforecment script that verifies that only specified file types are
allowed to be mared as executable.

Change-Id: I4b40e3a46b03bfc78a9dcd52e8bf29cb079b7f3b
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-18 17:38:22 +01:00
Michael Uhl
6a9a8d409d Bug 567217 - template functions with lvalue and rvalue parameters of
template tests added.

Change-Id: I1fbbb45c6d895505a66ad917b1342365118e28d0
2020-11-13 21:22:39 -05:00
Torbjörn Svensson
d0c3b2aaff Bug 568079: Reducing transitions from JAVA to native code (part 1)
Advapi32Util.registryGetValues() is more efficient to fetch all the
values since the regiter only needs to be opened once.

XXX: Due to a cycle in the dependencies we need to split this
in two parts, this commit handles the core.native API change
and the next commit handles the use of the new API

Change-Id: Ifd9f1ccc44c652ef3b517278bd342a486155c5fb
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-11 12:29:53 -05:00
Nathan Ridge
821c7e2277 Bug 567217 - Avoid incorrect cache hits during the instantiation of alias template instances
Change-Id: I2f21b0a097f9d279b6e32d28acd68091e3b9ad76
2020-11-10 00:06:29 -05:00
Marc-Andre Laperle
c0b26f9993 Bug 568625 - "Invalid arguments" using __underlying_type outside template
ICPPUnaryTypeTransformation was meant to be used only when the
transformation is applied on a dependent type. But it was actually
always used when creating types for decl specifiers, regardless if a
dependent type was involved or not. The untransformed type was causing
issues because code dealing with ITypes doesn't apply the transformation
everywhere. It seems better to apply the transformation early when
possible and let the rest of the logic intact.

Change-Id: I1b6d77a857e901f71f00e935e75d24cea87c3118
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-09 12:06:57 -05:00
Marc-Andre Laperle
4a83dbfbdd Bug 568427 - 'alloca' not resolved when parsing in the context of clang-cl
Don't define __STDC__ for clang-cl, just like msvc. Added a new compiler
type to differentiate clang-cl from clang in order to be able to add the
define just for clang and not clang-cl. I initially thought that the
unresolved symbol was caused by a missing built-in symbol (_alloca) so I
started to implement MSVC as a separate language from GNU and not
pollute GCCBuiltinSymbolProvider with a new concept of compiler type,
etc. But it turns out _alloca is also in declared in the headers and was
inactive because of the wrongly defined __STDC__. So this version of the
fix of adding a compiler type to GPPScannerExtensionConfiguration is
much less intrusive and risky, although adding a new language could have
its merit in case of more substantial change.

Change-Id: Ieb27b7dbcc531b8fd3fe30777cd7f343fd3ba66f
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-08 22:28:19 -05:00
Marc-Andre Laperle
aff9a3332d Bug 568616 - Support for __is_same and __is_same_as (built-in equivalent to std::is_same)
IType.isSameType was doing pretty much already what was needed. Added
GCC 6.0 and 10.0 parser configs to enable these built-ins for the proper
versions.

Change-Id: Ifd2908e726c098fb07c9420b29e2cb26014419bf
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-08 21:04:31 -05:00
Marc-Andre Laperle
c61e879532 Bug 568408 - Add more GCC built-ins symbols in parser (based on GCC 10.2.0)
Add the built-ins that are straightforward to add, according to
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Other-Builtins.html#Other-Builtins

Change-Id: I0d680053018442e6d29a694a7128997b23828d2f
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-07 13:57:16 -05:00
Torbjörn Svensson
7f7a310c07 Bug 568079: Warnings as errors
All compile warnings for native code should be handled.

Change-Id: I5ee391fd24339cb55646dbd2980d2856fabe8ddb
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-05 20:24:54 -05:00
Torbjörn Svensson
1d2946184a Bug 568079: Hook into Eclipse tracing system for native code
After loading the spawner library, call the native method
configureNativeTrace() that will query the Eclipse platform for several
debug option strings.

Change-Id: I031bb2cdc04ba2675913b3b2e320039c28139638
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-04 13:37:24 -05:00
Jonah Graham
09b1f93e7e Remove unreachable code
Change-Id: I76fd2ceef7ef000f191b39fcb470cb5d560595a6
2020-11-03 14:33:15 -05:00
Jonah Graham
7e3bb7c9ab Remove unused C Nature from cdt core
There are no C/C++ files in cdt.core.

Change-Id: I1769f630e9bd9aa10397976e56d26c88a7f630dd
2020-11-03 14:29:40 -05:00
Jonah Graham
213088e43a Bug 530194: Don't assume that dwarf headers have valid positions
In cases where the dwarf headers say there is data at a position that
does not exist, the position call throws an exception. Prior to this
patch that exception, being a runtime exception, can cause the whole
IDE to exit in the case that the standalone debugger is used.

Change-Id: I7e12667890490a49ecd63785ea2cc7c02c08679d
2020-11-03 11:05:21 -05:00
Torbjörn Svensson
35530c50ef Bug 568079: Rework spawner to avoid memory leaks on Win32
Change-Id: I1253351d47d52e848867d7f9df61a66f9bd82d41
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:55:05 +01:00
Torbjörn Svensson
c598eedffa Bug 568079: Cleanup of native code
* Unify pointer checkes
* Avoid using negated conditions.
* Reduce scope of local variables when possible

Change-Id: Ibacd13126351019af544f3e22513654d5ffee342
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:33:45 +01:00
Torbjörn Svensson
2857a7a0b3 Bug 568079: Do not require rebuild of natives to enable/disable tracing
Change-Id: I6e26c6febd56bcc23efe0ec65973b2f02a5fd809
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:33:45 +01:00
Torbjörn Svensson
6431307e70 Bug 568079: Reformat source code using clang-format
This will enforce formatting when building the native code

Change-Id: I6c047f4c0672609df322b7ba716fc786f0e3aab4
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:13:42 -04:00
Torbjörn Svensson
7f10dce12f Bug 568079: Remove unneded DllMain (does nothing)
Change-Id: Ib4489c6bcde43c6299550ec57c632bf666bcac6f
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:52 +01:00
Torbjörn Svensson
908aa33b91 Bug 568079: Activate -Wall -pedantic and fix warnings
Change-Id: I7dac7f9d90dd65cfbff241f9b778bc5ff6bc9db6
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
570c5b7ff0 Bug 568079: No need to check for NULL before free()
Change-Id: I4948ce07ed4ec426ce2a3bac226281409c25f7c9
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
3ae7b88630 Bug 568079: Add missing bracers
Change-Id: Icd916d224d4900cf2227f868f8b94cdae13c3f6b
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
82bc0b67e5 Bug 568079: Removed generate method comment from implementation
The comment is part of the generated header file

Change-Id: Ie890ad4d906c0f4e6a23b2a42a1ef342d1da8865
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:35 +01:00
Torbjörn Svensson
c5a53bb7fe Bug 568079: Format C/C++ code
Added a new C/C++ formatter profile called "Unmanaged profile 'CDT'"
(name stolen from the Java formatter) that is basically K&R with the
tweak of maxium line width set to 120 (same width as for .java files).

Added enforcement of the formatter during build.

libspawner.so/jnilib have differences because the re-formatting changes
line numbers and therefore the __LINE__ macro expands to a different
value.

Change-Id: Id3a0619cb31640c7817dc684c72139f90cab0fc6
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-24 16:54:40 -04:00
Marc-Andre Laperle
6ca0bb78bb Bug 329995 - Update all C/C++ views when the active configuration changes
Change the default workspace indexer setting

Use the active configuration by default, which is less confusing because
the UI is properly reflected on active config change.  Using a fixed
config can be seen as a more advanced setting for performance concerns.

A new preference is added, only used at default scope:
org.eclipse.cdt.core/cprojectdescription.configRelations
This can be used by products to customize the default according
to their needs (plugin_customization.ini).
This was done because this is a fairly impactful change for users.

Change-Id: I35888ffe5bc1814943f432f88a12094394924c88
Signed-off-by: Alex Freidin <freidin.alex@gmail.com>
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-20 22:59:41 -04:00
Marc-Andre Laperle
cebba80b36 Bug 567822 - [Dark Theme] Several controls using ControlFactory have wrong background (preferences, dialogs)
I don't think "inheriting" by hand the background colors is supposed to
be done like this. Removing the lines setting the background to be the
same as the parent fixes the issue. I also verified all places in the UI
before/after the change.

Change-Id: I2eb4cc5afdd303d5d5613fc3d50d67d0c18c7028
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-19 23:26:17 -04:00
Marc-Andre Laperle
bc76b0a7c3 Bug 567778 - [Include Browser] Cannot open the Include Browser on file outside source folder
CoreModelUtil.findTranslationUnit only returns CElement in the populated
CModel of a project. This shouldn't change as a large majority of client
code need to see the model this way and not consider files that are
outside source folders. So for a file not under a source folder (and
therefore not in the CModel), we can just create a new translation unit
instance for it. This is actually how the editor deals with it too.

Change-Id: I8898822e94cac8562edcc0a726fdd8680119faca
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-12 12:15:43 -04:00
Jonah Graham
a1201a811a Bug 567810: Squash over zealous warning from PDE
See also Bug 558477

Change-Id: I0765a2a49dc77e2f24af787b0f9a1e0e1e510a30
2020-10-12 10:14:26 -04:00
Jonah Graham
c40ed25daa [releng] Update API Filters
Remove old filters that are no longer relevant and mark some API warnings
as ignored.

Change-Id: Id687740b4261f9441f10804941a1d2aa1a3746c8
2020-10-12 10:14:26 -04:00
Jonah Graham
ac86378fe6 Bug 567261: API Filters and documentation for reverted API
Change-Id: I6b58a409dd8ac53f685036445fe517fbb1cdc76a
2020-10-12 08:49:31 -04:00
Marc-Andre Laperle
fa270ed30a [releng] Update plug-in versions
Version changes are all to refect non-API changes (micro version)

Change-Id: I372aa2671a4c7f5c765a42156d3f639b8eaff680
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-06 16:20:18 -04:00
Jonah Graham
24639efcee [releng] Bump version to 10.1.0
Change-Id: I39f7c379c0b43c086a25b047b3af564f6f24d670
2020-10-06 16:20:18 -04:00
Marc-Andre Laperle
41b741f358 Bug 567261 - Revert "541239: [C++17] Implement parser support for deduction guides"
This reverts commit bcb955a321.

Change-Id: Iaf6ba398e439e3d1da1e3a3b0247c7b24bbfb057
2020-10-05 21:40:00 -04:00
Marc-Andre Laperle
a6baac7172 Bug 567377 - Add built-ins for Clang already present in parser for other compilers
These were already there for GCC but not for Clang and they are
supported by Clang:
__is_literal (synonym for __is_literal_type)
__is_standard_layout
__is_trivial
__is_trivially_copyable
__float128
__int128

Change-Id: Iec6151492cd30f17e2a5aa4617f6e88812f0f4cc
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-03 12:42:48 -04:00
Marc-Andre Laperle
90a8376658 Add a comment to help explain one of the mysteries of SetCProjectDescriptionOperation
I'm not sure how sufficient this explanation is but it's better than
leaving just "// Why?" for that central piece of code in CDT.

Change-Id: I0858f83b8f4fbe65fd869e96fb210b5af7d16f65
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-03 10:13:24 -04:00
Marc-Andre Laperle
7a938095be Bug 567336 - Allow double-click on elements in Source Location and Output Location tab
Change-Id: Ifed7b5d005977db30f3c9ba4c7dc6a366691df53
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-02 23:52:52 -04:00
Marc-Andre Laperle
cb8e2c6887 Bug 567536 - In a Perforce workspace, untracked language.settings.xml always get prompted to get latest
IWorkspace.validateEdit should only be called if the file is read only.

Quoting IWorkspace.validateEdit javadoc "A client (such as an editor)
should perform a validateEdit on a file whenever it finds itself in the
following position: (a) the file is marked read-only, and (b) the client
believes it likely (not necessarily certain) that it will modify the
file's contents at some point."

Change-Id: Id73d3629f9ce276b931ed586a6dbf19199d56831
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-02 23:41:58 -04:00
Marc-Andre Laperle
cb0797481f Bug 566918 - [C++17] Support for __has_include (standard) and
__has_include_next (extension)

__has_include evaluates whether of the header name passed as parameter
exists. This can only be evaluated as part of a #if directive.
Interestingly, it also has to be reported as defined, i.e. #if
defined(__has_include) or #ifdef. In order to report this as defined,
this implementation adds it as a macro but during macro expansion, it's
actually converted as a dedicated token type. Then this token gets
evaluated during normal preprocessor expression evaluation.

In order to parse header names, there were several options. The main
problem is that header tokens (tQUOTE_HEADER_NAME, tSYSTEM_HEADER_NAME)
are actually produced by the Lexer as part of a special mode
(setInsideIncludeDirective) set during the handling of #include. For
expression evaluation, the tokens are already generated without
setInsideIncludeDirective therefore we only have plain string
and < > tokens.

One approach would be to generate header tokens "earlier" than executing
we need to track a new state while fetching token to configure the Lexer
(setInsideIncludeDirective) when in the context of an __has_include.
There are also complications due to macro expansion within the
__has_include where after one expansion, we don't have a lexer in the
context anymore, introducing more changes.

Another approach would be to remove the Header token creation from the
Lexer itself and let the preprocessor assemble the tokens into an header
string, in both cases of #include and __has_include. This mostly works
and is the approach used in Clang, but the problem is that whereas Clang
keeps track of leading spaces of tokens, CDT doesn't. This means with
such change that CDT would now allow #include <  iostream  > (notice the
white space). I think this is too big of a downside and also too big of
a change to introduce this handling of whitespace at the token level.

The approach used here is more conservative and isolated but also shares
less common logic with #include processing. The non-header token
(string, <, etc) are assembled into a header string only in the case of
a __has_include. So a downside will be that #include and __has_include
will be inconsistent in regards of leading/trailing space parsing but I
feel like this is better than making #include more permissive.

Change-Id: I5b9f5c616c8d999e0c916a85b41f96e20037b651
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-09-27 15:12:52 -04:00
Jonah Graham
65a4d1c424 Bug 546610: fix writeaccess_highlight color in dark theme
Uses same color as JDT in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=537988

Change-Id: I578b6c8e3ebf345d6a90214a3a919e0ee167ac8b
2020-09-07 10:55:00 -04:00
Jonah Graham
545597722a Bug 566713: Fix Widget Disposed exception with asyncExec
Change-Id: I37620534ec5c88da4acaa6e0a2cc789347a8d8d5
2020-09-06 21:47:32 -04:00
Torbjörn Svensson
5249144c8c Bug 521515: Build ppc64le libraries on HIPP
Change-Id: Idd05e27e02b712a0eb6940ebf90a201509140681
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-09-02 20:27:03 -04:00