This makes us independent of libclang crashes for completion.
Re-parsing for highlighting still happens in the Qt Creator process.
Run in verbose mode:
qtc.clangcodemodel.ipc=true
Run tests:
-test "ClangCodeModel"
Task-number: QTCREATORBUG-14108
Task-number: QTCREATORBUG-12819
Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Opening a main.cpp of a Qt Widget Application project that is configured
with a GCC toolchain leads to errors [1] like
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ia32intrin.h:41:10: \
error: use of undeclared identifier '__builtin_ia32_bsrsi'
due to a wrong determination of the clang directory with intrinsics. The
directory was determined as
$${LLVM_LIBDIR}/clang/$${LLVM_VERSION}/include
whereas $LLVM_VERSION was extracted as e.g. "3.5" from 'llvm-config
--version' instead of "3.5.0".
The path of clang intrinsics dir shipped with Qt Creator (as package)
does also match this version scheme:
$QTC_INSTALL_DIR/share/qtcreator/cplusplus/clang/3.4.2/include
[1] Visible with qtc.clangcodemodel.verboserun=true
Change-Id: I1061912eef437a9889987e638915d2fabe208011
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
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>
Most of the functions were quite generic and not specific to clang.
Change-Id: I160cfeb7eca5b69ad6a8932a4f76db5bf5c1d42d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
.. 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>
Instead of having two lists of paths, now only one list is used where
both include paths and framework paths can be mixed. This reflects the
way the compiler is invoked, and retains the (correct) search order.
Task-number: QTCREATORBUG-11599
Change-Id: I373953e3e305df5b7a0d10920e12d146584adf9f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Format: QTC_*=(1|0).
Now it's easier to change them in the Run Configuration of Qt Creator.
Change-Id: Ifc45cecb89b33a31942b4c3e2d03851a1d72d0bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
The flags used by the project explorer to interrogate the toolchain for
compiler-defined #defines always indicate a C++ file. So, this will
always include a #define for __cplusplus. When editing C code with
the clang code model, this results in extern "C" linkage specifications,
which result in warnings or errors.
The proper fix is described in QTCREATORBUG-11709, but is too big to be
done within the 3.1 timeframe.
Task-number: QTCREATORBUG-11501
Change-Id: Id9e261fa8d429fead4a2cd5fd7398aa6e1e8c13d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This field is used by the generic project manager which passes the
".config" file in it. The advantage is that both the SnapshotUpdater and
the clang code model do not need to do anything smart, but can pass it
directly to the preprocessor.
Task-number: QTCREATORBUG-11390
Change-Id: I44fc7b20afd28fb59608412f2cce86af6f7e7d6b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Do not search the standard system directories for include files, but do
search compiler builtin include directories. To make sure that the
include files for intrinsics are the ones clang can parse, put that
path first on the command-line.
Change-Id: I2ada992b58203d1c3dbd55851c5f195c12572943
Reviewed-by: Eike Ziller <eike.ziller@digia.com>