[llvm-bugs] [Bug 31112] New: libclang should not require that a CXUnsavedFile should exist on disk

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 22 01:24:08 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31112

            Bug ID: 31112
           Summary: libclang should not require that a CXUnsavedFile
                    should exist on disk
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at qt.io
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

The documentation [1] states that an unsaved file must exist on disk. This
requirement makes it hard to implement IDEs supporting in-memory files of code
generators.

If the libclang client provides unsaved files that do not exist on disk yet,
the preamble generation will be part of every parse/reparse/completion
operation, at least if CXTranslationUnit_PrecompiledPreamble is used and as a
result, all those operations will be very slow.

The specific case we have in Qt / Qt Creator:

A Qt project can contain *.ui files. Those are the input for the uic tool,
which generates "ui_*.h" header files. Part of the Qt Creator IDE is the
feature that a *.ui file can be edited and behind the scenes the "ui_*.h"
header will be updated automatically (without saving anything to disk; writing
into the build directory is not an option), so that highlighting/completion in
a *.cpp files including that header file will reflect those changes. This works
fine as long unsaved file exist on disk (e.g. project was already build), but
for the case that a project is opened for the very first time (no ui_*.h files
generated yet on disk) or some new *.ui files are just added to the project
this will result in the described performance regression.

Also, because of the resulting performance regression once the requirement is
not fulfilled, special care needs to be taken to check the unsaved files for
actual existence in the file system.

Please remove this requirement and fix the described performance issue.

[1]
http://clang.llvm.org/doxygen/structCXUnsavedFile.html#aa8bf5d4351628ee8502b517421e8b418

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161122/1784b416/attachment-0001.html>


More information about the llvm-bugs mailing list