diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-02 02:19:29 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-02 02:19:29 +0000 |
commit | 5595ded882b22d77fdf535bd1a4c6c090110348a (patch) | |
tree | 1b0bf3735552431fc3ddb4647212fe5217802427 /tools/libclang/CXLoadedDiagnostic.cpp | |
parent | 3fa3feab35096b608f1d79bb541798b37a55e7b9 (diff) |
libclang: introduce cxstring::{createRef,createDup} for StringRefs
Also migrate all clients from the old API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CXLoadedDiagnostic.cpp')
-rw-r--r-- | tools/libclang/CXLoadedDiagnostic.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/libclang/CXLoadedDiagnostic.cpp b/tools/libclang/CXLoadedDiagnostic.cpp index b9c4135cb4..4b269948de 100644 --- a/tools/libclang/CXLoadedDiagnostic.cpp +++ b/tools/libclang/CXLoadedDiagnostic.cpp @@ -97,7 +97,7 @@ CXSourceLocation CXLoadedDiagnostic::getLocation() const { } CXString CXLoadedDiagnostic::getSpelling() const { - return cxstring::createCXString(Spelling, false); + return cxstring::createRef(Spelling); } CXString CXLoadedDiagnostic::getDiagnosticOption(CXString *Disable) const { @@ -106,8 +106,8 @@ CXString CXLoadedDiagnostic::getDiagnosticOption(CXString *Disable) const { // FIXME: possibly refactor with logic in CXStoredDiagnostic. if (Disable) - *Disable = createCXString((Twine("-Wno-") + DiagOption).str()); - return createCXString((Twine("-W") + DiagOption).str()); + *Disable = cxstring::createDup((Twine("-Wno-") + DiagOption).str()); + return cxstring::createDup((Twine("-W") + DiagOption).str()); } unsigned CXLoadedDiagnostic::getCategory() const { @@ -115,7 +115,7 @@ unsigned CXLoadedDiagnostic::getCategory() const { } CXString CXLoadedDiagnostic::getCategoryText() const { - return cxstring::createCXString(CategoryText); + return cxstring::createDup(CategoryText); } unsigned CXLoadedDiagnostic::getNumRanges() const { @@ -195,7 +195,7 @@ class DiagLoader { if (error) *error = code; if (errorString) - *errorString = createCXString(err); + *errorString = cxstring::createDup(err); } void reportInvalidFile(llvm::StringRef err) { @@ -627,7 +627,7 @@ LoadResult DiagLoader::readDiagnosticBlock(llvm::BitstreamCursor &Stream, if (readString(TopDiags, RetStr, "FIXIT", Record, Blob, /* allowEmptyString */ true)) return Failure; - D->FixIts.push_back(std::make_pair(SR, createCXString(RetStr, false))); + D->FixIts.push_back(std::make_pair(SR, cxstring::createRef(RetStr))); continue; } |