Commit Graph

31 Commits

Author SHA1 Message Date
Nikolai Kosjar
70bc5e842c CppTools: Add toolchain type to project part and use it
Making CompilerOptionsBuilder to use the toolchain from the project part
simplifies its public API, but following the code paths initiated by
ClangCodeModel and ClangStaticAnalyzer gets harder, so better enable the
separation of those by making CompilerOptionsBuilder a base class.

Change-Id: I0a6bb3f8323ba09b88135a7f9d1ef967331a8ff0
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-06-29 09:14:48 +00:00
Nikolai Kosjar
dcccb4cb8d CppTools: Use CompilerOptionsBuilder as an object
Makes the client code more readable.

Change-Id: Ie98ba93c758643039d3ebdc7550b1c4ac9473298
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-06-26 07:23:38 +00:00
Nikolai Kosjar
65137313b0 CppTools: Do not return a language option for ProjectFile::Unclassified
This led to an invalid command line ("-x" without further argument).

Change-Id: I8cfe1a8a29789fba426b61fe3702496d8089db6b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-03 09:15:41 +00:00
Christian Kandeler
24eea82477 Toolchains: Add C++98 as a language standard.
This was curiously missing from the CompilerFlag enum, so e.g. setting
"QMAKE_CXXFLAGS += -std=c++98" in a .pro file did not have the desired
effect on higher-level code such as the code model.

Change-Id: Ia4323b699a2ccea9d3cbde10b05affe87d955277
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-14 14:04:28 +00:00
Friedemann Kleint
fb80206f3c Clean exported headers of the CppTools plugin.
Change-Id: I0144ac33e88980c431c54a6d69bbde28da4b1967
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 08:16:48 +00:00
Orgad Shaneh
f3a2795c3b C++: Use correct features for document parsing
Task-number: QTCREATORBUG-8007
Change-Id: Ic96aaa433442812a99bac9d16bb9124d66762e8c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-20 12:54:49 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Nikolai Kosjar
478914a9ce CppTools: Unexport ProjectFileAdder
Change-Id: Icf53019b594a5c45b06f7f1fab0f4bf36e891918
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-09 16:08:26 +00:00
Orgad Shaneh
65e7db42b8 C++: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 15:27:22 +00:00
Nikolai Kosjar
2992653a4d CppTools: Remove workaround for quotes in defines
...since by now we get the defines in the correct format from
QMakeProject.

See the change this one depends on.

Tested with:

    Qbs:   cpp.defines: [ 'PATH1="/some/path"', "PATH2=\"/some/path\"" ]
    QMake: DEFINES += PATH1=\\\"/some/path\\\" "PATH2=\\\"/some/path\\\""
    CMake: add_definitions(-DPATH1="/some/path" "-DPATH2=\"/some/path\"")

All these lines translate to

    #define PATH1 "/some/path"
    #define PATH2 "/some/path"

for the code model.

Change-Id: Ifc3d3acff3abab6897ccbd0c5fafd5c415dfb53c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-04 09:05:58 +00:00
Christian Kandeler
b6a0dbeec7 CppTools: Make CompilerOptionsBuilder hide intrinsics.
Change-Id: I8b677fc82672ca5fd36bae18480467ef95201dcc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 15:19:18 +00:00
Christian Kandeler
f567565d26 CppTools: Filter out "bad" symbols when collecting compiler defines.
Not all defines make sense for non-compilation purposes.

Change-Id: I7c5dd5aaa6de5c8916dfc10eb54ae49efa22959d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-29 12:12:42 +00:00
Christian Kandeler
e7a18108e1 CppTools: Fix macro collection.
"#define XYZ" does not correspond to "-DXYZ" (which means
"#define XYZ 1"), but to "-DXYZ=".

Change-Id: I3ed44e1457b3df52dc9bdb930ba8f4a04784d207
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-27 15:25:23 +00:00
Christian Kandeler
ea1efad6f1 CppTools: Support MSVC in CompilerOptionsBuilder.
Needed for clang static analyzer.

Change-Id: I0221b7e87f7b52a4aa5ebf7f4b26c19e584d63e7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-26 17:01:40 +01:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
b5b47f7df2 Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/cppeditor/cppdocumentationcommenthelper.cpp

Change-Id: I2cf25eba1de149765a6c44ad354d606ce9de512d
2015-01-08 10:38:20 +01:00
Nikolai Kosjar
a5e2b4b149 CppTools: Check for valid active target
The active target might be 0 if e.g. there are not kits and a project is
imported.

Task-number: QTCREATORBUG-13730
Change-Id: I48ade507fefc555d1d3f8230ba82c00270fa457b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-06 10:19:03 +01:00
Nikolai Kosjar
205170a9e5 CppTools: Create ProjectInfos explicitly
...instead of going through CppModelManager::projectInfo().

Now CppModelManager::projectInfo() returns an invalid ProjectInfo in
case there is no valid data for the given Project.

Change-Id: I11908bf2ddf865b1d3d71ff176eaf4139292b21c
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-19 10:16:37 +01:00
Christian Stenger
38c08abde5 ProjectPartBuild: Fix framework paths
Task-number: QTCREATORBUG-13137
Change-Id: I71a222a4048db65db462da07726ea5d6b917da8d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-20 15:06:19 +01:00
Nikolai Kosjar
e510c80c92 CppTools: Provide whether a sub project is selected for building
Analyzers can use this to rule out irrelevant (sub) projects.

Change-Id: I5a9eb66f06156f0619dc639f6f4080a8fc761ee6
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2014-11-07 12:10:22 +01:00
Nikolai Kosjar
33359a7922 CppTools: Add API to set/query compiler call data
...and make some comparison functions public.

Change-Id: If4c9a95031dece32073ce111484a890230190688
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-07 10:27:17 +01:00
Nikolai Kosjar
5a1ffe6f1c CppTools: Remove ProjectInfo::operator bool()
This one does not buy us much...

Change-Id: I1d6c4667c038d319d2c16166505a386653a9f066
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-06 16:45:24 +01:00
Nikolai Kosjar
c183386144 CppTools: Remove un-used function
Change-Id: Ib346359487cb06c0fc95ff5796e9dd6f220b9d16
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-30 10:03:31 +01:00
Nikolai Kosjar
f07b876a93 Move some functions from ClangCodeModel to CppTools
Most of the functions were quite generic and not specific to clang.

Change-Id: I160cfeb7eca5b69ad6a8932a4f76db5bf5c1d42d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-20 13:11:08 +02:00
Eike Ziller
9c7019f0b2 License update.
Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-15 15:19:55 +02:00
Erik Verbruggen
990cedeb1b C++: remove C/C++ distinction from ProjectPart fields.
.. because they now hold only files for a single language+extensions
combination.

Task-number: QTCREATORBUG-11709
Task-number: QTCREATORBUG-12818
Change-Id: If294f6de07d60126be733d98de12b89b8af3efce
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-16 17:01:35 +02:00
Erik Verbruggen
7290c43da1 C++: update project info once after finishing adding all project parts.
So that recalculating the information is not O(n^2) but linear.

Change-Id: I69903e0b5ad321d071804d782ad634a3f300e71a
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-12 17:42:32 +02:00
Erik Verbruggen
cc70b603d3 C++: Change QStringList to QSet<QString> to prevent conversions.
This eliminates a bunch of list->set->list conversions. Especially the
ProjectInfo::appendProjectPart takes lots of time converting for every
part added.

Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-09-04 15:59:40 +02:00
Erik Verbruggen
8b2cff4b8b C++: introduce the unique ProjectPart::id()
And change the code-model inspector dialog to use them in the
ProjectParts tab to sync the master/details view, and in the
CppPreProcessorDialog to save/reload the selected part.

Change-Id: I7cc8ac1c21d31122f8650985d0b85177ebabdfb8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-28 18:58:26 +02:00
Erik Verbruggen
876ea282d2 GenericProject: put different languages into separate project parts.
This is in preparation for changes to the ProjectParts, where one part
can only hold files for 1 language.

Change-Id: I5e9a1a803ecc3ecbb36added0d0094df63922549
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-21 13:11:03 +02:00
Nikolai Kosjar
6b5298faf9 CppTools: Move Project{Part,Info} to new cppprojects.{h,cpp}
Change-Id: Ieff216017b9da1e6a12121688ea9572bdd81fd9b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:28:35 +02:00