1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00
Commit graph

13510 commits

Author SHA1 Message Date
Doug Schaefer
b495a5faae Hook up the clang toolchain now split out from GCC.
Change-Id: I6edba9e689d903546be3a65060c4ac1b9871167f
2017-11-07 13:13:12 -05:00
Nathan Ridge
daad877559 Bug 526684 - Use InstantiationContext.setExpandPack() in CPPTemplates.instantiateTypes() if appropriate
InstantiationContext.setExpandPack() and related methods were introduced
in bug 486971 to ensure that when instantiating a type list that
contains a pack expansion, with a parameter map that maps the template
parameter pack that appears in the expansion to another parameter pack
(which can happen when e.g. instantiating an alias template with
dependent arguments), the pack is expanded in the correct place.

However, bug 486971 only added use of this machinery to CPPTemplates.
instantiateArguments(). We can also instantiate a type list in
instantiateTypes() (used e.g. when instantiating the parameter types
of a function type), so the machinery needs to be used there as well.

Change-Id: Iabb458e8e3166c15ed922656fc0729a4a8cf8bbf
2017-11-07 12:11:24 -05:00
Doug Schaefer
76e1842644 Implement ordering of toolchains.
Introduce toolchain types independent of providers.

Change-Id: I2cf3145920fcf4e7132468b6e653d7ea3e211127
2017-11-07 11:01:15 -05:00
Marco Syfrig
9a9e80e115 Bug 526724: corrected deduced type for string literals with u8 prefix
Change-Id: Ibc55f6cbd8f425149598b397a4d2fb90b7ed6b8b
Signed-off-by: Marco Syfrig <marco.syfrig@gmail.com>
2017-11-07 04:22:50 +01:00
Doug Schaefer
87cd8401f4 Hook up the error parser properly in the build configuration.
So we can have the error partitions that work with double clicking
in the build console.

Change-Id: I357f4efb8fd16232b78b18958c9863071feeebcc
2017-11-03 16:48:20 -04:00
Mustafa Yücel
2e0f85e514 Bug 520340: enable CLI to CDT's code formatter
example usage:
eclipse -nosplash -application org.eclipse.cdt.core.CodeFormatter -consoleLog \
        -verbose -config .settings/org.eclipse.cdt.core.prefs src/

imported CodeFormatterApplication from eclipse.jdt.core:
org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java
revision 823698366b88fe7e6c1438813d7dd191ff9aa71f
org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/messages.properties
revision c2646812d22906feca88c2f52911ca7c4eae2299

Change-Id: Id934c8958c66f562bd2402dcbd8b7c60e39cc7a5
Signed-off-by: Mustafa Yücel <mustafa.yuecel@siemens.com>
2017-11-02 07:03:22 -04:00
Doug Schaefer
89cb1076e4 Improve when build like autotools is trying to execute a script.
The new Autotools core build executes autoreconf which is a perl
script. We've been assuming up until now they were always
Windows exes or bats. If there's no proper extension, try
finding sh and passing the command to it.

Change-Id: I71ba66d7658db0bdc45608abc356b5efe80669af
2017-11-01 10:42:18 -04:00
Doug Schaefer
3935339cf7 Fix API baseline errors from Command Launcher changes.
Change-Id: Ibc5ba38669832f6baa67ff49ce4fe08ab1f5a14a
2017-10-31 15:57:56 -04:00
Nathan Ridge
4bf930decb Bug 526391 - Make Database.stringCache a ConcurrentHashMap since it can be accessed concurrently by multiple threads
Change-Id: I79b88197ade9831100b13e5429bfb62248a28f06
2017-10-30 12:46:41 -04:00
Nathan Ridge
e96d2f92c8 Bug 526134 - Recover from failure to parse a base-clause in a class-specifier
Change-Id: I642650020dc2c0363376c8172769f4b5ea2d90c4
2017-10-25 13:14:31 -04:00
Jeff Johnston
c96d126b86 Bug 513589 - Add support to build CDT projects in a Docker Container
- add IOptionalBuildObjectPropertiesContainer interface to use for
  objects that supply optional build properties
- add new IOptionalBuildProperties interface that defines
  optional build properties donated by external plug-ins
- add new
- change IConfiguration to an IOptionalBuildObjectPropertiesContainer
- change IManagedProject to be an
  IOptionalBuildObjectPropertiesContainer
- fix ProcessClosure to ensure that readers are not null before
  accessing them
- fix Container launch delegate to look at project optional
  build properties for active configuration to fetch connection
  and image info and use said info to find a matching
  launch or create a new one
- have Container launch delegate use the image name as part of
  the launch config name
- have Container launch short-cut also use the project's
  optional build properties for the active config to get
  connection and image information before any defaulting
- change AutotoolsNewMarkerGenerator to store the command
  launcher as an ICommandLauncher
- add new CommandLauncherFactory extension to cdt.core that
  allows plug-ins to specify a CommandLauncherFactory that
  will return an ICommandLauncher based on the project
- add macros for new extension to CCorePlugin
- add new CommandLauncherManager class that loads
  CommandLauncherFactory extensions and is used to give
  an ICommandLauncher wrapper that will go through the list
  of CommandLauncherFactory extensions until one returns
  non-null ICommandLauncher
- add code to RemoteCommandLauncher so it will use the
  CommandLauncherManager to get the local launcher
- also change RemoteCommandLauncher to check at execution
  time whether the command is local and in that case use
  the local command launcher
- add new ICommandLauncherFactory interface
- add new ContainerCommandLauncher to launch
- add new ContainerCommandLauncherFactory class for returning
  a ContainerCommandLauncher instance to launch commands
  in a Docker Container
- change MakeBuilder to use CommandLauncherManager to get
  its ICommandLauncher
- change CommandBuilder to use CommandLauncherManager too
- ditto for Builder and AbstractBuiltinSpecsDetector and
  ExternalToolInvoker
- change Configuration to load/store optional build properties
  as well as return the properties to get/set
- ditto for MultiConfiguration
- change ManagedProject to implement IOptionalBuildOptionProperties
  interface
- ditto for ProjectType
- create new OptionalBuildProperties class to store optional
  build properties for a configuration
- bump cdt.docker.launcher to 1.1.0
- use CommandLauncherFactory extension to define
  ContainerCommandLauncherFactory
- add optional ContainerPropertyTab which allows the end-user to
  optionally choose to build a C/C++ project in a Container
  and specify the connection/image to use
- in LanguageSettingsSerializableSettings class, call the
  CommandLauncherManager getLanguageSettingEntries method
  to get the massaged language setting entries based on the
  current list
- in LanguageSettingsProviderSerializer, try and get the
  pooled entries using the cfg description so that it will
  have the project and can use the CommandLauncherManager
  to get entries from image
- in ContainerCommandLauncherFactory move cached headers under
  a HEADERS directory in the plug-in area
  - create a sub-directory for the connection and a sub-directory
    for the image based on cleansed names
  - store the real names of the connection and image to use
    later in the DockerHeaderPreferencePage
- modify LanguageSettingsEntriesTab to force the horizontal
  scroll bar to appear (this is a bug in SWT SashForm support
  and the fix here isn't quite correct, but is better)
- add new DockerHeaderPreferencePage that allows user to
  remove cached headers from images
- change C/C++ Docker preferences to be titled: Docker Container
- fix LanguageSettingsWorkspaceProvider.getSettingEntries method
  to use the CommandLauncherManager so entries will be transformed
  to use cached headers
- add BaseDatabindingModel class
- add DataVolumeModel class to model a volume mount
- add ContainerPropertyVolumes model to model volume specification
  and selected volumes
- add properties to ContainerCommandLauncher to represent
  volumes and selected volumes for a configuration
- add ContainerDataVolumeDialog for specifying a volume
  mount by the end-user
- add a null detector for cfgDescription in
  LanguageSettingsSerializableProvider
- fix AutotoolsNewMakeGenerator.getWinOSType to not specify "." for
  working dir
- fix GCCBuiltinSpecsDetectorCygwin to not map paths to Cygwin if
  the current configuration is enabled for container build
- add logic to ContainerCommandLauncher to look for Windows
  file formats and change them to unix format and map
  any "." working dir to be /tmp
- fix ContainerLauncherConfigurationDelegate similarly
- fix AbstractBuiltinSpecsDetector to pass in the current
  configuration description when getting the CommandLauncher
  since the current configuration may not be the active
  configuration
- change ContainerPropertyTab to add Elf and GNU Elf binary parsers
  when build in Container is chosen so that output executables
  are treated as Binaries by the CDT project
- add documentationl for the ContainerPropertyTab in Build Settings and
  the Data Volume dialog pop-up it brings up
- change CommandBuilder to accept a project as an argument
  to its constructor and to pass this as an argument to
  the CommandLauncherManager
- have StepBuilder pass project when creating a CommandBuilder

Change-Id: Ia78488b93056e6ec7ca83a6c87b3a9d2b9424943
2017-10-22 05:38:51 -04:00
Nathan Ridge
4c1a6e0ccd Bug 486140 - Cast expression with label reference expression as operand
Change-Id: I77d8e7dabc64f68818f4222ffe3d6ba7eebae542
2017-10-21 14:38:48 -04:00
Nathan Ridge
20cebd8f6f Bug 525982 - Have TypeOfUnknownMember implement ICPPUnknownBinding
This ensures that name resolution can proceed when a TypeOfUnknownMember
appears on the left hand side of a scope resolution operator.

Change-Id: I2dfc22eb474b8a2f776eda09ce90c91462d7fe5b
2017-10-20 15:32:58 -04:00
Doug Schaefer
50756f3f18 Fix bugs with emscripten and scannerInfo.
Change-Id: I54d3691426a48c2a6f71fee4188364e57eea402d
2017-10-19 12:52:38 -04:00
Doug Schaefer
416fed4d94 Make CMake support more resilient.
Add c++ to GCCToolChain since that's what CMake uses by default for
MinGW. Synchronize the scannerInfoCache loading. Double check for
toolchain files at load time for configs that don't have any.

Change-Id: I8071e285ce5deb1448cabd45f394c62fe6a7f2f4
2017-10-18 12:41:40 -04:00
Doug Schaefer
2198597a98 Make no toolchain error handling more generic and reuse with Qt
In particular when Qt Installs are missing. This is a similar scenario
to when toolchains are missing.

Change-Id: Ic78f71436e46c73900a556133c3883df807784d9
2017-10-17 10:38:23 -04:00
Nathan Ridge
48d5342815 Bug 519121 - Avoid building excessively long type strings in ASTTypeUtil
A type can appear as a constituent of another type multiple times.
For example, in 'A<T, T>', 'T' appears as a constituent twice.

When building a type string for 'A<T, T>', this means the type string
of 'T' will appear in the type string of 'A<T, T>' twice.

If such a duplication occurs at every level of a deeply nested type
structure, the length of the type string can become exponential in
the nesting depth.

To avoid this, an optimization is added where, past a length threshold,
type strings refer to constituent types "by reference" rather than
by containing the contents of the constituent type's type string.

Change-Id: Iaea268449a11b598f113a49fc61e9993bb6451da
2017-10-16 13:53:43 -04:00
Nathan Ridge
1054a38b44 Improve tracking of lookup points
ASTCache now sets the AST as the initial lookup point when invoking
an ASTRunnable.

In addition, OpenDeclarationsJob sets the selected node as a more precise
lookup point.

Change-Id: I9b32fccd80bc1b13e6da49a80a896b595784b868
2017-10-16 13:11:26 -04:00
Nathan Ridge
45101e2a64 Bug 512297 - Improve caching of type strings in ASTTypeUtil
Previously, caching of type strings would only be done during indexing.

Now, it is done every time an AST is available, including operations
like semantic highlighting and mark occurrences.

This is important, because without caching, ASTTypeUtil can end up
rebuilding the same type string many times, leading to quadratic
performance on some code patterns.

Change-Id: I260877f820665cbe0939c0c3065514559592e721
2017-10-15 14:32:18 -04:00
Nathan Ridge
e05566a452 Rename EvalParameterPack to EvalPackExpansion
EvalParameterPack was a misleading name. This evaluation represents
a pack expansion expression; the expansion pattern has to contain
one or more parameter packs, but they can be nested inside an
arbitrarily complex expression.

Change-Id: I16d09c349fc6c2b1086e37fd6743f613f02bf5eb
2017-10-15 14:29:35 -04:00
Doug Schaefer
affb599f24 Allow for changing manually setting toolchains for build configs.
A number of changes that clean up how build configs are done. Now
build settings are stored with the build config instead of in launch
configs. That makes it less launch bar specific. Add build settings
UI to change the toolchain used for a given launch config.

Also changed CMake so it's IToolchain based instead of property which
doesn't work when multiple IToolchains match.

Change-Id: I958d90ede3c1f873ab1530c2b2880808e8f7abef
2017-10-12 16:03:58 -04:00
Michael Woski
4b3aea7e2a bug 525794 - NPE when invoking Open Declaration in "empty space"
Change-Id: I09a8670d113553c9046d829526149f869f4029a4
Signed-off-by: Michael Woski <woskimi@yahoo.de>
2017-10-11 16:51:33 -04:00
Doug Schaefer
11dcec43f2 Add UI tests plugin for CMake. Fix a couple of bugs it found.
Also restructures the pom.xmls to put the modules in the top level
so we can order them to have the test plugins build after them.

Change-Id: I2f0e4ebd252791fb8844cdf0f635d574946207aa
2017-10-06 16:36:51 -04:00
Thomas Corbat
07e8917eb5 Bug 525645 - Named type specifiers in friend declarations
Change-Id: Ia67fb35ef3d20cde97322c07e697e3437c6c769d
Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
2017-10-06 09:41:53 -04:00
Michael Woski
a7be934ba2 bug 525288 - resolve partial template specializations in
CSourceHover/OpenDeclaration

Change-Id: I61c06fc453499ddc2b1af73a8a69d4b648d473c3
Signed-off-by: Michael Woski <woskimi@yahoo.de>
2017-10-05 17:58:21 -04:00
Nathan Ridge
89ebafa72e Bug 512297 - Decrease the template instantiation depth limit to 128
The previous limit of 256 was not sufficient to prevent stack
overflows in some cases.

Change-Id: Ied9171ed3020f2de7932fa9ee50780bd207d8707
2017-10-04 12:21:20 -04:00
Nathan Ridge
98e1153ba0 Add a comment describing the intended uses of CPPSemantics.getCurrentLookupPoint()
Change-Id: Ib4ba467a093873c16a1ff155e27c38c11a7590ce
2017-10-04 12:07:35 -04:00
Nathan Ridge
bf73bb58bc Bug 512297 - Impose a limit on the nesting depth of template arguments
This avoid stack overflows when processing code that has very deeply
nested template arguments.

Change-Id: I748e2d827fd1e7842737ec0652cf3733ae9962b1
2017-10-03 22:26:19 -04:00
Nathan Ridge
c7e475e50e Bug 524338 - Make sure SemanticHighlightingTest.teardown() is called even if an exception was thrown during the test run
Change-Id: Idd19728c2e920d1bb8a590863c40d8646f916e1a
2017-10-03 22:25:02 -04:00
Nathan Ridge
33d33a8cd6 Bug 525350 - Ensure a lookup point is always set during indexing, code analysis, and code completion
Also push a more accurate lookup point in a few places.

Change-Id: I635569178d8d9afd23f7782aeebdaed714f1a10d
2017-10-03 22:23:09 -04:00
Nathan Ridge
e1b68206ae Bug 524258 - NPE in QuickAssistProcessor.runOnAST()
Change-Id: I65653080a5a8f20567809d0d43126aff5a974a46
2017-10-02 21:26:28 -04:00
Nathan Ridge
20a88df65c Bug 399147 - Make 'Find References' find using-declarations
This is a revised approach for fixing this bug by giving using-
declarations implicit names for each delegate binding.

Change-Id: Ib9695c30258b8cb322ae1548ab022e357318135c
2017-10-02 02:44:02 -04:00
Nathan Ridge
e7c64e785b Bug 515417 - Improve handling of friend classes in PDOM
According to the standard, if a friend declaration is the only
declaration of a class type, then that class type is only
visible to argument-dependent lookup until another declaration
is encountered.

Bug 508338 attempted to implement this rule for PDOM class
types by not storing the class type in the index at all when
that first declaration is encountered. However, this meant
not recording the friend relationship either, which regressed
CompletionTests.testTypes_FriendClass (which was then disabled).

Bug 512932 implemented this rule for AST class types in a
different way, by keeping track of which names are visible to
ADL only.

This change reverts the fix for bug 508338, and extends the
approach from bug 512932 to PDOM class types. It also re-
enabled CompletionTests.testTypes_FriendClass which now passes.

Change-Id: I9a845fdba514339d86c0c3761a85cf34a17a5613
2017-10-02 01:59:31 -04:00
Doug Schaefer
5228d19300 UI for adding toolchains for Core Build. New Generic Target Wizard.
Provide a way to add new toolchains. Also start of UI to allow for
reordering them to help with toolchain selection for targets.

New Generic Target Wizard for the new wizard2 extension point for the
Launch Bar Target UI.

Change-Id: I60635ab27dad5b69df72c339337473183dcf711a
2017-09-28 13:42:58 -04:00
Nathan Ridge
80dc8d9c25 Bug 513105 - Avoid pushing a null lookup point in CPPVisitor.createType()
ArrayDeque doesn't allow null elements.

Change-Id: Ib610cfedf02232d30b4fc4e1b4d4d5ba45d7aee3
2017-09-28 12:13:57 -04:00
Nathan Ridge
bb9d1db323 Bug 518937 - Apply declaredBefore() filtering to index bindings found in a namespace scope
Previously, such filtering was only done in resolveAmbiguities(),
which was too late for name lookup for proceed to an enclosing
scope if it did not find valid candidates in the namespace scope.

Change-Id: I435d7be1aff5344985c1bbb201bf5d383d43fe8d
2017-09-27 18:58:02 -04:00
Nathan Ridge
2fe856426c Fix a couple of potential leaks of the PDOM write lock
This fixes a couple of places where a call to
PDOM.acquireWriteLock() is not paired with a call to
releaseWriteLock() in a finally block.

Change-Id: I45a8bd9a2f6585bb4c4bc1f726fea6f9eba5fb43
2017-09-26 13:39:54 -04:00
Nathan Ridge
64709c980d Bug 513105 - Store the current lookup point in a thread-local static stack rather than passing it around everywhere
Change-Id: I3da7326d1ce6bede8d4787d98f38fb2064288338
2017-09-25 12:51:22 -04:00
Nathan Ridge
9869cbc9ba Bug 522461 - NPE in ParameterGuesser.createVariable()
Change-Id: I68c2588866c9b4228134643bfa246452ee483c80
2017-09-25 12:49:38 -04:00
Nathan Ridge
2a94c46209 Bug 522459 - NPE in ExecRangeBasedFor.loopOverArray()
Change-Id: Ife66cef5ca07655371bf83489881d9f2baf61f92
2017-09-25 12:48:12 -04:00
Nathan Ridge
2aeb75d147 Bug 522509 - Handle typedefs in __is_class builtin
Change-Id: Ief3efa8e660ab1f7ec11788be8dad69da2501aa6
2017-09-20 00:15:59 -04:00
Michael Woski
709689b36e Bug 521016 - resolution error for nested alias template specialization
from
index


Change-Id: Ia36f096cc4765341a62d8c6139a487c714854e97
Signed-off-by: Michael Woski <woskimi@yahoo.de>
2017-09-19 19:29:35 +02:00
Nathan Ridge
9011fe1a95 Bug 522066 - Use the declarator as the key for the recursion protection set in createAutoType()
Previously, the decl-specifier was used as the key, but a decl-specifier
can be shared by multiple declarators, so seeing the same decl-specifier
against doesn't necessarily mean we have infinite recursion.

Change-Id: I165088c5379d412d1c31f2655c20a02629fbe596
2017-09-19 00:28:34 -04:00
Andrey Loskutov
398307d9bb Bug 522411 - ConcurrentModificationException below
CModelListener.addLastRecentlyUsed (thrown in
LinkedHashMap$LinkedHashIterator.nextNode)

CModelListener reacts on all the resource events, but is NOT MT-safe due
the not guarded access to the "fLRUs" map, which can be iterated AND
modified at same time by different threads.

This commit introduces synchronization on the "fLRUs" map field. This is
safe as the field is private and not exposed to other objects, and the
code inside synchronized block does not call into other locks which
might interfere.

Change-Id: I3e601f02e93e40a1454c9a581fa46378904eb3dc
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2017-09-18 17:01:06 +02:00
Michael Woski
4e7354e1b0 Bug 456224 - CPPDeferredClassInstance not bound to partial template
specialization

Change-Id: I91482bf3f27becaea796a2c20875f97d92157644
Signed-off-by: Michael Woski <woskimi@yahoo.de>
2017-09-16 09:08:21 +02:00
Andrey Loskutov
eb70c04ceb Bug 522176 - NullPointerException in DeltaAnalyzer.processResourceDelta
Change-Id: I25606e5c1f4e15e9048df139bb6a2e60f8214508
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2017-09-13 11:24:38 -04:00
Nathan Ridge
dfd7a7164c Bug 521817 - Implement PDOMCPPAliasTemplate.update()
This ensures that if the target type of an alias template changes,
the target type is updated in the index during an incremental index
update, without requiring a full index rebuild.

Change-Id: I8800e3c1701409276f8db64000499a5fa9caf6a9
2017-09-13 11:23:03 -04:00
Nathan Ridge
39795a203a Bug 521848 - NPE in CPPFunctionTemplateSpecialization.equals()
Change-Id: I666c1a5d21aa7b644a6ebdc92be3ee51acda42d2
2017-09-12 19:48:01 -04:00
Michael Woski
c5b4657220 bug 521820 - don't filter alias template for CPPASTNamedTypeSpecifier
Change-Id: Ie66b148aabaf7f73bb639359c46d3d2d974c305f
Signed-off-by: Michael Woski <woskimi@yahoo.de>
2017-09-12 19:46:34 -04:00
Doug Schaefer
c3f3da9f25 Core Build - add support for Generic target
Adapts to LaunchBar's new Build Tab extension.

Change-Id: Icad41a7083f4389a546234d2835a9c4b60fa0eae
2017-09-07 15:52:28 -04:00