Replace GlobalScopeAsm[GlobalScopeAsm.size()-1] with GlobalScopeAsm.back(), NFC.

llvm-svn: 262775
This commit is contained in:
Yaron Keren 2016-03-05 16:02:09 +00:00
parent 5c61d11a6d
commit ce608690e1
1 changed files with 2 additions and 4 deletions

View File

@ -262,8 +262,7 @@ public:
/// A trailing newline is added if the input doesn't have one.
void setModuleInlineAsm(StringRef Asm) {
GlobalScopeAsm = Asm;
if (!GlobalScopeAsm.empty() &&
GlobalScopeAsm[GlobalScopeAsm.size()-1] != '\n')
if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
GlobalScopeAsm += '\n';
}
@ -271,8 +270,7 @@ public:
/// A trailing newline is added if the input doesn't have one.
void appendModuleInlineAsm(StringRef Asm) {
GlobalScopeAsm += Asm;
if (!GlobalScopeAsm.empty() &&
GlobalScopeAsm[GlobalScopeAsm.size()-1] != '\n')
if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
GlobalScopeAsm += '\n';
}