diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
| commit | 29cafa66ad3878dbb9f82615f19fa0bded2e443c (patch) | |
| tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /tools/libclang/CIndexDiagnostic.cpp | |
| parent | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (diff) | |
Notes
Diffstat (limited to 'tools/libclang/CIndexDiagnostic.cpp')
| -rw-r--r-- | tools/libclang/CIndexDiagnostic.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp index fa3b1cec7fb3..0fcdab70bebc 100644 --- a/tools/libclang/CIndexDiagnostic.cpp +++ b/tools/libclang/CIndexDiagnostic.cpp @@ -220,7 +220,8 @@ CXString clang_getDiagnosticOption(CXDiagnostic Diag, CXString *Disable) { return createCXString(""); unsigned ID = StoredDiag->Diag.getID(); - if (const char *Option = DiagnosticIDs::getWarningOptionForDiag(ID)) { + llvm::StringRef Option = DiagnosticIDs::getWarningOptionForDiag(ID); + if (!Option.empty()) { if (Disable) *Disable = createCXString((llvm::Twine("-Wno-") + Option).str()); return createCXString((llvm::Twine("-W") + Option).str()); |
