Repository: JuliaLang/julia
File: src/jitlayers.h (C/C++)

Code before:
        bool sanitize_thread=true,
#else
        bool sanitize_thread=false,
#endif
#ifdef _COMPILER_ASAN_ENABLED_
        bool sanitize_address=true
#else
        bool sanitize_address=false
#endif
) JL_NOTSAFEPOINT {
        return {lower_intrinsics, dump_native, external_use, llvm_only,
                always_inline, enable_early_simplifications,
                enable_early_optimizations, enable_scalar_optimizations,
                enable_loop_optimizations, enable_vector_pipeline,
                remove_ni, cleanup, warn_missed_transformations,
                sanitize_memory, sanitize_thread, sanitize_address};
    }
};

struct PrintOptions {
    bool print_before_all = false;
    bool print_after_all = false;
    bool print_module_scope = false;
    // TODO: Add print_changed support. This would require integrating with LLVM's
    // ChangedIRPrinter infrastructure to print IR only when passes modify it.
    // See llvm/Passes/StandardInstrumentations.h for PrintChangedIRData.
    std::string print_before;  // specific pass name
    std::string print_after;   // specific pass name
    std::string filter_print_funcs;  // filter for function names
    raw_ostream *out = nullptr; // output stream (default: errs())

    PrintOptions() JL_NOTSAFEPOINT = default;
    ~PrintOptions() JL_NOTSAFEPOINT = default;
    PrintOptions(const PrintOptions &) JL_NOTSAFEPOINT = default;
    PrintOptions(PrintOptions &&) JL_NOTSAFEPOINT = default;
    PrintOptions &operator=(const PrintOptions &) JL_NOTSAFEPOINT = default;
    PrintOptions &operator=(PrintOptions &&) JL_NOTSAFEPOINT = default;

    static PrintOptions defaults() JL_NOTSAFEPOINT {
        return PrintOptions();
    }
};

// Parse LLVM-style option string into PrintOptions
void parseLLVMOptions(const char *options, PrintOptions &out) JL_NOTSAFEPOINT;

struct NewPM {
    std::unique_ptr<TargetMachine> TM;
    OptimizationLevel O;
    OptimizationOptions options;
    PrintOptions print_options;

Review comment (suggestion):
That isn't a very useful link. The link for the ChangeReporter is here:
https://llvm.org/doxygen/classllvm_1_1ChangeReporter.html#a7a57fcd8f955992d5167dae6978748f2

(and is simply a text diff, nothing fancy, no "integration" is required)

Code after:
        bool sanitize_thread=true,
#else
        bool sanitize_thread=false,
#endif
#ifdef _COMPILER_ASAN_ENABLED_
        bool sanitize_address=true
#else
        bool sanitize_address=false
#endif
) JL_NOTSAFEPOINT {
        return {lower_intrinsics, dump_native, external_use, llvm_only,
                always_inline, enable_early_simplifications,
                enable_early_optimizations, enable_scalar_optimizations,
                enable_loop_optimizations, enable_vector_pipeline,
                remove_ni, cleanup, warn_missed_transformations,
                sanitize_memory, sanitize_thread, sanitize_address};
    }
};

struct PrintOptions {
    bool print_before_all = false;
    bool print_after_all = false;
    bool print_module_scope = false;
    // TODO: Add print_changed support using LLVM's ChangeReporter (a text diff).
    // See https://llvm.org/doxygen/classllvm_1_1ChangeReporter.html
    SmallVector<std::string, 1> print_before;  // specific pass names (comma-separated or repeated)
    SmallVector<std::string, 1> print_after;   // specific pass names (comma-separated or repeated)
    SmallVector<std::string, 1> filter_print_funcs;  // filter for function names (comma-separated or repeated)
    std::string error;  // error messages from parsing
    raw_ostream *out = nullptr; // output stream (default: errs())

    PrintOptions() JL_NOTSAFEPOINT = default;
    ~PrintOptions() JL_NOTSAFEPOINT = default;
    PrintOptions(const PrintOptions &) JL_NOTSAFEPOINT = default;
    PrintOptions(PrintOptions &&) JL_NOTSAFEPOINT = default;
    PrintOptions &operator=(const PrintOptions &) JL_NOTSAFEPOINT = default;
    PrintOptions &operator=(PrintOptions &&) JL_NOTSAFEPOINT = default;

    static PrintOptions defaults() JL_NOTSAFEPOINT {
        return PrintOptions();
    }
};

// Parse LLVM-style option string into PrintOptions
void parseLLVMOptions(const char *options, PrintOptions &out) JL_NOTSAFEPOINT;

struct NewPM {
    std::unique_ptr<TargetMachine> TM;
    OptimizationLevel O;
    OptimizationOptions options;
    PrintOptions print_options;