Add prefix to the diagnostic engine
- add the prefix "cling" (normal interpreter error) or "cling-ptx" (ptx interpreter -> just in CUDA mode) to every interpreter error message - example before: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. - example after: cling: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. cling-ptx: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. cling-ptx: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.
This commit is contained in:
parent
c7558a2c0d
commit
b8e245ac4f
@ -873,7 +873,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static llvm::IntrusiveRefCntPtr<DiagnosticsEngine>
|
static llvm::IntrusiveRefCntPtr<DiagnosticsEngine>
|
||||||
SetupDiagnostics(DiagnosticOptions& DiagOpts) {
|
SetupDiagnostics(DiagnosticOptions& DiagOpts, std::string ExeName) {
|
||||||
// The compiler invocation is the owner of the diagnostic options.
|
// The compiler invocation is the owner of the diagnostic options.
|
||||||
// Everything else points to them.
|
// Everything else points to them.
|
||||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> DiagIDs(new DiagnosticIDs());
|
llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> DiagIDs(new DiagnosticIDs());
|
||||||
@ -881,6 +881,8 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
|
|||||||
std::unique_ptr<TextDiagnosticPrinter>
|
std::unique_ptr<TextDiagnosticPrinter>
|
||||||
DiagnosticPrinter(new TextDiagnosticPrinter(cling::errs(), &DiagOpts));
|
DiagnosticPrinter(new TextDiagnosticPrinter(cling::errs(), &DiagOpts));
|
||||||
|
|
||||||
|
DiagnosticPrinter->setPrefix(ExeName);
|
||||||
|
|
||||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine>
|
llvm::IntrusiveRefCntPtr<DiagnosticsEngine>
|
||||||
Diags(new DiagnosticsEngine(DiagIDs, &DiagOpts,
|
Diags(new DiagnosticsEngine(DiagIDs, &DiagOpts,
|
||||||
DiagnosticPrinter.get(), /*Owns it*/ true));
|
DiagnosticPrinter.get(), /*Owns it*/ true));
|
||||||
@ -1333,7 +1335,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
|
|||||||
// Everything else points to them.
|
// Everything else points to them.
|
||||||
DiagnosticOptions& DiagOpts = InvocationPtr->getDiagnosticOpts();
|
DiagnosticOptions& DiagOpts = InvocationPtr->getDiagnosticOpts();
|
||||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags =
|
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags =
|
||||||
SetupDiagnostics(DiagOpts);
|
SetupDiagnostics(DiagOpts, COpts.CUDADevice ? "cling-ptx" : "cling");
|
||||||
if (!Diags) {
|
if (!Diags) {
|
||||||
cling::errs() << "Could not setup diagnostic engine.\n";
|
cling::errs() << "Could not setup diagnostic engine.\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user