Clang.jl icon indicating copy to clipboard operation
Clang.jl copied to clipboard

Allow -x c++ to work

Open vchuravy opened this issue 1 year ago • 7 comments

vchuravy avatar May 16 '23 02:05 vchuravy

Attempt at fixing https://github.com/JuliaInterop/Clang.jl/issues/430#issuecomment-1548781755

vchuravy avatar May 16 '23 02:05 vchuravy

Struggles still with:

/// Severity of a diagnostic.
enum MlirDiagnosticSeverity {
  MlirDiagnosticError,
  MlirDiagnosticWarning,
  MlirDiagnosticNote,
  MlirDiagnosticRemark
};
typedef enum MlirDiagnosticSeverity MlirDiagnosticSeverity;

vchuravy avatar May 16 '23 02:05 vchuravy

Motivating PR in MLIR.jl https://github.com/JuliaLabs/MLIR.jl/pull/10, but of course kinda ugly since we suddenly have to deal with new things...

vchuravy avatar May 16 '23 16:05 vchuravy

Allowing -x c++ is not enough for generic C++ support, we need to add C++ standard library and system headers like what has been done in ClangCompiler.jl: https://github.com/Gnimuc/ClangCompiler.jl/blob/master/src/platform/system.jl

Gnimuc avatar May 27 '23 14:05 Gnimuc

Struggles still with:

/// Severity of a diagnostic.
enum MlirDiagnosticSeverity {
  MlirDiagnosticError,
  MlirDiagnosticWarning,
  MlirDiagnosticNote,
  MlirDiagnosticRemark
};
typedef enum MlirDiagnosticSeverity MlirDiagnosticSeverity;

Is this problem caused by the audit step?

I added an option no_audit in this PR which might be helpful...

Gnimuc avatar May 27 '23 14:05 Gnimuc

is not enough for generic C++ support, we need to add C++ standard library and system headers like what has been done in ClangCompiler.jl

Yeah I don't need generic C++ support, more C headers written by C++ people... E.g. MLIR headers contain some C++-ism

vchuravy avatar May 28 '23 19:05 vchuravy

Is this problem caused by the audit step?

No the issue is that C++ mode changes the representation of some of the Clang nodes. I needed https://github.com/JuliaInterop/Clang.jl/pull/435 to sucesfully parse the MLIR headers.

vchuravy avatar May 28 '23 19:05 vchuravy