[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove the
now unused static helper function.
The test case needs to be remove temporarily until I can better filter memory
operands that aren't actual variable reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165751 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 3c3a9eb..9b6b6c9 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -353,19 +353,6 @@
return Name;
}
-// getIdentifierInfo - Given a Name and a range of tokens, find the associated
-// IdentifierInfo*.
-static IdentifierInfo *getIdentifierInfo(StringRef Name,
- ArrayRef<Token> AsmToks,
- unsigned Begin, unsigned End) {
- for (unsigned i = Begin; i <= End; ++i) {
- IdentifierInfo *II = AsmToks[i].getIdentifierInfo();
- if (II && II->getName() == Name)
- return II;
- }
- return 0;
-}
-
// getSpelling - Get the spelling of the AsmTok token.
static StringRef getSpelling(Sema &SemaRef, Token AsmTok) {
StringRef Asm;
@@ -624,10 +611,7 @@
if (Context.getTargetInfo().isValidGCCRegisterName(Name))
continue;
- IdentifierInfo *II = getIdentifierInfo(Name, AsmToks,
- AsmTokRanges[StrIdx].first,
- AsmTokRanges[StrIdx].second);
- if (II) {
+ if (IdentifierInfo *II = &Context.Idents.get(Name)) {
CXXScopeSpec SS;
UnqualifiedId Id;
SourceLocation Loc;