[cfe-commits] r165751 - in /cfe/trunk: lib/Sema/SemaStmtAsm.cpp test/CodeGen/ms-inline-asm.c
Chad Rosier
mcrosier at apple.com
Thu Oct 11 14:28:29 PDT 2012
Author: mcrosier
Date: Thu Oct 11 16:28:29 2012
New Revision: 165751
URL: http://llvm.org/viewvc/llvm-project?rev=165751&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/Sema/SemaStmtAsm.cpp
cfe/trunk/test/CodeGen/ms-inline-asm.c
Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=165751&r1=165750&r2=165751&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Thu Oct 11 16:28:29 2012
@@ -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;
Modified: cfe/trunk/test/CodeGen/ms-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=165751&r1=165750&r2=165751&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c Thu Oct 11 16:28:29 2012
@@ -167,12 +167,3 @@
// CHECK: t19
// CHECK: call void asm sideeffect inteldialect "mov eax, $2\0A\09mov $0, eax\0A\09mov eax, $3\0A\09mov $1, eax", "=*m,=*m,*m,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}, i32* %{{.*}}, i32* %{{.*}}, i32* %{{.*}}) nounwind
}
-
-void t20(void) {
- __asm {
- mov eax, fs:[0x10]
- mov eax, [eax]
- }
-// CHECK: t20
-// call void asm sideeffect inteldialect "mov eax, fs:[0x10]\0A\09mov eax, [eax]", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
-}
More information about the cfe-commits
mailing list