diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-22 02:21:54 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-22 02:21:54 +0000 |
commit | 31097581aad843ffb85befeeedb2e23a4d8cc287 (patch) | |
tree | bb169eaa18a5fcf9baef086f133e1c6d2bafa80a /clang/lib/AST/Decl.cpp | |
parent | db0e7061c6b45357f83b121d6b97f67104288993 (diff) | |
download | bcm5719-llvm-31097581aad843ffb85befeeedb2e23a4d8cc287.tar.gz bcm5719-llvm-31097581aad843ffb85befeeedb2e23a4d8cc287.zip |
ms-inline-asm: Scope inline asm labels to functions
Summary:
This fixes PR20023. In order to implement this scoping rule, we piggy
back on the existing LabelDecl machinery, by creating LabelDecl's that
will carry the "internal" name of the inline assembly label, which we
will rewrite the asm label to.
Reviewers: rnk
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4589
llvm-svn: 218230
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index cc7c11ca6ef..aec7059490c 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -3709,6 +3709,13 @@ LabelDecl *LabelDecl::CreateDeserialized(ASTContext &C, unsigned ID) { SourceLocation()); } +void LabelDecl::setMSAsmLabel(StringRef Name) { + char *Buffer = new (getASTContext(), 1) char[Name.size() + 1]; + memcpy(Buffer, Name.data(), Name.size()); + Buffer[Name.size()] = '\0'; + MSAsmName = Buffer; +} + void ValueDecl::anchor() { } bool ValueDecl::isWeak() const { |