diff options
| author | Joey Gouly <joey.gouly@gmail.com> | 2014-06-05 21:23:42 +0000 |
|---|---|---|
| committer | Joey Gouly <joey.gouly@gmail.com> | 2014-06-05 21:23:42 +0000 |
| commit | 9266985b619ddd85632a0616af41f0e917646c24 (patch) | |
| tree | c15b22ab3bce40bd3116c8574eecb858ca23966f /lib/CodeGen/CodeGenAction.cpp | |
| parent | f6a54b977d50f16291be44ec26715f1e6a2d543d (diff) | |
| download | clang-9266985b619ddd85632a0616af41f0e917646c24.tar.gz clang-9266985b619ddd85632a0616af41f0e917646c24.tar.bz2 clang-9266985b619ddd85632a0616af41f0e917646c24.tar.xz | |
When an inline-asm diagnostic is reported by the backend, report it with the
correct severity.
Previously all inline-asm diagnostics were reported as errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenAction.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenAction.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index a197faece1..f593ccf431 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -297,13 +297,24 @@ void BackendConsumer::InlineAsmDiagHandler2(const llvm::SMDiagnostic &D, FullSourceLoc Loc; if (D.getLoc() != SMLoc()) Loc = ConvertBackendLocation(D, Context->getSourceManager()); - + unsigned DiagID; + switch (D.getKind()) { + case llvm::SourceMgr::DK_Error: + DiagID = diag::err_fe_inline_asm; + break; + case llvm::SourceMgr::DK_Warning: + DiagID = diag::warn_fe_inline_asm; + break; + case llvm::SourceMgr::DK_Note: + DiagID = diag::note_fe_inline_asm; + break; + } // If this problem has clang-level source location information, report the - // issue as being an error in the source with a note showing the instantiated + // issue in the source with a note showing the instantiated // code. if (LocCookie.isValid()) { - Diags.Report(LocCookie, diag::err_fe_inline_asm).AddString(Message); + Diags.Report(LocCookie, DiagID).AddString(Message); if (D.getLoc().isValid()) { DiagnosticBuilder B = Diags.Report(Loc, diag::note_fe_inline_asm_here); @@ -319,10 +330,10 @@ void BackendConsumer::InlineAsmDiagHandler2(const llvm::SMDiagnostic &D, return; } - // Otherwise, report the backend error as occurring in the generated .s file. - // If Loc is invalid, we still need to report the error, it just gets no + // Otherwise, report the backend issue as occurring in the generated .s file. + // If Loc is invalid, we still need to report the issue, it just gets no // location info. - Diags.Report(Loc, diag::err_fe_inline_asm).AddString(Message); + Diags.Report(Loc, DiagID).AddString(Message); } #define ComputeDiagID(Severity, GroupName, DiagID) \ |
