[cfe-dev] TextDiagnosticPrinter::HandleDiagnostic() question
John McCall
rjmccall at apple.com
Fri Apr 22 13:46:02 PDT 2011
On Apr 22, 2011, at 11:45 AM, Andrew Fish wrote:
> When using the x86_64-pc-win32-macho triple we end up compiling and debugging on OS X and building a Win32 API (for us really an EFI API) image.
>
> The following code in TextDiagnosticPrinter::HandleDiagnostic() causes diagnostic messages that don't work with Xcode
>
> // Emit a Visual Studio compatible line number syntax.
> if (LangOpts && LangOpts->Microsoft) {
> OS << PLoc.getFilename() << '(' << LineNo << ')';
> OS << " : ";
> } else {
> OS << PLoc.getFilename() << ':' << LineNo << ':';
> if (DiagOpts->ShowColumn)
> if (unsigned ColNo = PLoc.getColumn())
> OS << ColNo << ':';
> }
>
> On the backend side I know that we use things like Triple.getEnvironment() != llvm::Triple::MachO. I'm not sure what we do on the front end.
>
> Seems to me that LangOpts->Microsoft implies code construction and not OS version that the system is running on?
I agree; this should be triggered by the target, not LangOptions.Microsoft. On the other hand...
> So how could we make normal clang diagnostics appear for for the 86_64-pc-win32-macho triple?
...I would think that this triple suggests a Microsoft target.
This was introduced in r90642, which refers to <rdar://problem/6309338>, if you want to figure out what the right trigger for this is.
John.
More information about the cfe-dev
mailing list