diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-11-14 09:44:14 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-11-14 13:12:38 +0300 |
commit | 6861d938e5c946cc7079d9849ef7560d07aa2d80 (patch) | |
tree | 0134b8f98b411e7435f8f4f0a58851fa3724750e /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | e51631ca4cf461510019d5fc950eacb2fe45eb48 (diff) | |
download | llvm-6861d938e5c946cc7079d9849ef7560d07aa2d80.zip llvm-6861d938e5c946cc7079d9849ef7560d07aa2d80.tar.gz llvm-6861d938e5c946cc7079d9849ef7560d07aa2d80.tar.bz2 |
Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM"
See discussion in https://bugs.llvm.org/show_bug.cgi?id=45073 / https://reviews.llvm.org/D66324#2334485
the implementation is known-broken for certain inputs,
the bugreport was up for a significant amount of timer,
and there has been no activity to address it.
Therefore, just completely rip out all of misexpect handling.
I suspect, fixing it requires redesigning the internals of MD_misexpect.
Should anyone commit to fixing the implementation problem,
starting from clean slate may be better anyways.
This reverts commit 7bdad08429411e7d0ecd58cd696b1efe3cff309e,
and some of it's follow-ups, that don't stand on their own.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 871cdb7..1e935bb 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -404,9 +404,6 @@ namespace clang { bool StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D); /// Specialized handler for unsupported backend feature diagnostic. void UnsupportedDiagHandler(const llvm::DiagnosticInfoUnsupported &D); - /// Specialized handler for misexpect warnings. - /// Note that misexpect remarks are emitted through ORE - void MisExpectDiagHandler(const llvm::DiagnosticInfoMisExpect &D); /// Specialized handlers for optimization remarks. /// Note that these handlers only accept remarks and they always handle /// them. @@ -674,36 +671,6 @@ void BackendConsumer::UnsupportedDiagHandler( << Filename << Line << Column; } -void BackendConsumer::MisExpectDiagHandler( - const llvm::DiagnosticInfoMisExpect &D) { - StringRef Filename; - unsigned Line, Column; - bool BadDebugInfo = false; - FullSourceLoc Loc; - std::string Msg; - raw_string_ostream MsgStream(Msg); - DiagnosticPrinterRawOStream DP(MsgStream); - - // Context will be nullptr for IR input files, we will construct the diag - // message from llvm::DiagnosticInfoMisExpect. - if (Context != nullptr) { - Loc = getBestLocationFromDebugLoc(D, BadDebugInfo, Filename, Line, Column); - MsgStream << D.getMsg(); - } else { - DiagnosticPrinterRawOStream DP(MsgStream); - D.print(DP); - } - Diags.Report(Loc, diag::warn_profile_data_misexpect) << MsgStream.str(); - - if (BadDebugInfo) - // If we were not able to translate the file:line:col information - // back to a SourceLocation, at least emit a note stating that - // we could not translate this location. This can happen in the - // case of #line directives. - Diags.Report(Loc, diag::note_fe_backend_invalid_loc) - << Filename << Line << Column; -} - void BackendConsumer::EmitOptimizationMessage( const llvm::DiagnosticInfoOptimizationBase &D, unsigned DiagID) { // We only support warnings and remarks. @@ -881,9 +848,6 @@ void BackendConsumer::DiagnosticHandlerImpl(const DiagnosticInfo &DI) { case llvm::DK_Unsupported: UnsupportedDiagHandler(cast<DiagnosticInfoUnsupported>(DI)); return; - case llvm::DK_MisExpect: - MisExpectDiagHandler(cast<DiagnosticInfoMisExpect>(DI)); - return; default: // Plugin IDs are not bound to any value as they are set dynamically. ComputeDiagRemarkID(Severity, backend_plugin, DiagID); |