diff options
| author | Yury Gribov <y.gribov@samsung.com> | 2016-01-28 09:27:46 +0000 |
|---|---|---|
| committer | Yury Gribov <y.gribov@samsung.com> | 2016-01-28 09:27:46 +0000 |
| commit | 976892fefcd538f8671de85b620c2abda7aecb32 (patch) | |
| tree | acff49a897266b6eea98f604d30b6cc010b7414b /clang | |
| parent | 42852d99e7523326590b095b1fa0176b82b535d6 (diff) | |
| download | bcm5719-llvm-976892fefcd538f8671de85b620c2abda7aecb32.tar.gz bcm5719-llvm-976892fefcd538f8671de85b620c2abda7aecb32.zip | |
Small refactor in isBeforeInTranslationUnit.
Differential Revision: http://reviews.llvm.org/D15804
llvm-svn: 259030
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 4c501616a3e..959d4d414a6 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -2089,10 +2089,10 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS, // Clear the lookup cache, it depends on a common location. IsBeforeInTUCache.clear(); - llvm::MemoryBuffer *LBuf = getBuffer(LOffs.first); - llvm::MemoryBuffer *RBuf = getBuffer(ROffs.first); - bool LIsBuiltins = strcmp("<built-in>", LBuf->getBufferIdentifier()) == 0; - bool RIsBuiltins = strcmp("<built-in>", RBuf->getBufferIdentifier()) == 0; + const char *LB = getBuffer(LOffs.first)->getBufferIdentifier(); + const char *RB = getBuffer(ROffs.first)->getBufferIdentifier(); + bool LIsBuiltins = strcmp("<built-in>", LB) == 0; + bool RIsBuiltins = strcmp("<built-in>", RB) == 0; // Sort built-in before non-built-in. if (LIsBuiltins || RIsBuiltins) { if (LIsBuiltins != RIsBuiltins) @@ -2101,8 +2101,8 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS, // lower IDs come first. return LOffs.first < ROffs.first; } - bool LIsAsm = strcmp("<inline asm>", LBuf->getBufferIdentifier()) == 0; - bool RIsAsm = strcmp("<inline asm>", RBuf->getBufferIdentifier()) == 0; + bool LIsAsm = strcmp("<inline asm>", LB) == 0; + bool RIsAsm = strcmp("<inline asm>", RB) == 0; // Sort assembler after built-ins, but before the rest. if (LIsAsm || RIsAsm) { if (LIsAsm != RIsAsm) |

