diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-01 16:38:28 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-01 16:38:28 +0000 |
commit | 99d1b295031ea4e74630914c14f94d919aa8e8dc (patch) | |
tree | c7e01596b00004583d6c1df4d7097e7f5fb205b2 /clang/lib/Lex | |
parent | 8b021c382d3e4afdf310ab8bbddd8012c7c9dc93 (diff) | |
download | llvm-99d1b295031ea4e74630914c14f94d919aa8e8dc.zip llvm-99d1b295031ea4e74630914c14f94d919aa8e8dc.tar.gz llvm-99d1b295031ea4e74630914c14f94d919aa8e8dc.tar.bz2 |
Use StringRef for MemoryBuffer identifier API (NFC)
llvm-svn: 283043
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/HeaderMap.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp index 4cace5b..24a14b6 100644 --- a/clang/lib/Lex/HeaderMap.cpp +++ b/clang/lib/Lex/HeaderMap.cpp @@ -106,7 +106,7 @@ bool HeaderMapImpl::checkHeader(const llvm::MemoryBuffer &File, /// getFileName - Return the filename of the headermap. -const char *HeaderMapImpl::getFileName() const { +StringRef HeaderMapImpl::getFileName() const { return FileBuffer->getBufferIdentifier(); } diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index bf266b3..c2c909e3 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -257,7 +257,7 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) { /// getName - Return the directory or filename corresponding to this lookup /// object. -const char *DirectoryLookup::getName() const { +StringRef DirectoryLookup::getName() const { if (isNormalDir()) return getDir()->getName(); if (isFramework()) diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 73036ac..42e7de2 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -284,7 +284,7 @@ bool Preprocessor::CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef, if (ShadowFlag) *ShadowFlag = false; if (!SourceMgr.isInSystemHeader(MacroNameLoc) && - (strcmp(SourceMgr.getBufferName(MacroNameLoc), "<built-in>") != 0)) { + (SourceMgr.getBufferName(MacroNameLoc) != "<built-in>")) { MacroDiag D = MD_NoWarn; if (isDefineUndef == MU_Define) { D = shouldWarnOnMacroDef(*this, II); @@ -2114,7 +2114,7 @@ void Preprocessor::HandleIncludeMacrosDirective(SourceLocation HashLoc, // This directive should only occur in the predefines buffer. If not, emit an // error and reject it. SourceLocation Loc = IncludeMacrosTok.getLocation(); - if (strcmp(SourceMgr.getBufferName(Loc), "<built-in>") != 0) { + if (SourceMgr.getBufferName(Loc) != "<built-in>") { Diag(IncludeMacrosTok.getLocation(), diag::pp_include_macros_out_of_predefines); DiscardUntilEndOfDirective(); |