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

            Bug ID: 23197
           Summary: Usage of "-fsyntax-only" in lib Tooling not compatible
                    with cl driver mode
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The string literal "-fsyntax-only" is used in several places of the clang code.
However this option is not a valid option in cl mode. Code which uses this
literal must be sure that the cl mode is not set. In cl mode the corresponding
option is "/Zs".

I am using clang tooling on windows in cl mode. The method
getClangSyntaxOnlyAdjuster() adds the option "-fsyntax-only" to clang tools
without checking for cl mode.

Result: A warning is shown that the option "-fsyntax-only" is not supported.

Expected result: No warning issued for options which were not specified on the
command line.

Two alternative changes fixed this issue for me:

A) Use "/Zs" instead of "-fsyntax-only" in function
getClangSyntaxOnlyAdjuster() when in cl mode.

B) Make -fsyntax-only a CoreOption in Options.td. Reading the sources, only
options with flags CLOption or CoreOption are valid in cl mode.

I am quite new to the LLVM/Clang code so I cannot say how an appropriate fix
would look like.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to