[llvm-bugs] [Bug 50249] New: [Python] CompilationDatabase.getCompileCommands does not work as documented

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 6 12:58:21 PDT 2021


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

            Bug ID: 50249
           Summary: [Python] CompilationDatabase.getCompileCommands does
                    not work as documented
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: edaskel at att.net
                CC: llvm-bugs at lists.llvm.org

Created attachment 24838
  --> https://bugs.llvm.org/attachment.cgi?id=24838&action=edit
Standalone reproduction

The documentation for getCompileCommands() says:

        Get an iterable object providing all the CompileCommands available to
        build filename. Returns None if filename is not found in the database.

The actual behavior for the "not found" case differs in surprising ways:

1. When a regular source file (e.g. .cpp) is not found, an empty iterable is
returned instead of None
2. If a header file (e.g. .h) is not found, a guess at the compile command is
made and returned

I believe the documentation should be updated to reflect the actual behavior.

-- 
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/20210506/ec496df7/attachment.html>


More information about the llvm-bugs mailing list