[cfe-dev] TextDiagnosticPrinter::HandleDiagnostic() question

Andrew Fish afish at apple.com
Fri Apr 22 11:45:29 PDT 2011


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? 

So how could we make normal clang diagnostics appear for for the 86_64-pc-win32-macho triple?

Thanks,

Andrew Fish

> Example:
> 
> clang /Users/fish/work/edk2/InOsEmuPkg/BootModePei/BootModePei.c
> /Users/fish/work/edk2/InOsEmuPkg/BootModePei/BootModePei.c:27:10: fatal error: 'PiPei.h' file not found
> #include <PiPei.h>
>        ^
> 1 error generated.
> 
> vs
> 
> clang -ccc-host-triple x86_64-pc-win32-macho  /Users/fish/work/edk2/InOsEmuPkg/BootModePei/BootModePei.c
> /Users/fish/work/edk2/InOsEmuPkg/BootModePei/BootModePei.c(27) :  fatal error: 'PiPei.h' file not found
> #include <PiPei.h>
>        ^
> 1 error generated.
> 
> (27) does not work for Xcode, but :27:10 does. 
> 

Andrew Fish








More information about the cfe-dev mailing list