diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-18 20:27:06 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-18 20:27:06 +0000 |
commit | b91b3f88adcd0fe3ee603f032a141d1229e3c3bb (patch) | |
tree | 5ad8eaf07db8069a9cadce6f99b54de6cfc75def /clang/lib/Sema/SemaStmtAsm.cpp | |
parent | 0f295dec0df17cf23a4ac7f4e742f98af72127d8 (diff) | |
download | bcm5719-llvm-b91b3f88adcd0fe3ee603f032a141d1229e3c3bb.tar.gz bcm5719-llvm-b91b3f88adcd0fe3ee603f032a141d1229e3c3bb.zip |
[ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,
which will be used by the asm matcher in the near future.
llvm-svn: 166221
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index 875821c14dc..172cfe55bea 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -367,14 +367,16 @@ public: MCAsmParserSemaCallbackImpl(class Sema *Ref) { SemaRef = Ref; } ~MCAsmParserSemaCallbackImpl() {} - void *LookupInlineAsmIdentifier(StringRef Name, void *SrcLoc) { + void *LookupInlineAsmIdentifier(StringRef Name, void *SrcLoc, unsigned &Size){ SourceLocation Loc = SourceLocation::getFromPtrEncoding(SrcLoc); - NamedDecl *OpDecl = SemaRef->LookupInlineAsmIdentifier(Name, Loc); + NamedDecl *OpDecl = SemaRef->LookupInlineAsmIdentifier(Name, Loc, Size); return static_cast<void *>(OpDecl); } }; -NamedDecl *Sema::LookupInlineAsmIdentifier(StringRef Name, SourceLocation Loc) { +NamedDecl *Sema::LookupInlineAsmIdentifier(StringRef Name, SourceLocation Loc, + unsigned &Size) { + Size = 0; LookupResult Result(*this, &Context.Idents.get(Name), Loc, Sema::LookupOrdinaryName); @@ -391,6 +393,9 @@ NamedDecl *Sema::LookupInlineAsmIdentifier(StringRef Name, SourceLocation Loc) { NamedDecl *ND = Result.getFoundDecl(); if (isa<VarDecl>(ND) || isa<FunctionDecl>(ND)) { + if (VarDecl *Var = dyn_cast<VarDecl>(ND)) + Size = Context.getTypeInfo(Var->getType()).first; + return ND; } |