summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-08 17:28:34 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-08 17:28:34 +0000
commit42924431012107c78d77af227020757b371c4e2f (patch)
tree5ea712504fbe5914b9847b108b3d5b3720172822 /clang/lib/Sema/SemaStmtAsm.cpp
parent731685e6bcf04bf40254430de5356692d7bffa27 (diff)
downloadbcm5719-llvm-42924431012107c78d77af227020757b371c4e2f.tar.gz
bcm5719-llvm-42924431012107c78d77af227020757b371c4e2f.zip
ms-inline-asm: Correctly mark MS inline ASM labels as used
Summary: This fixes PR21155. Test Plan: The patch includes a test. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5619 llvm-svn: 219322
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index 7f79a05b46d..a2e436ae7ee 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/lib/Sema/SemaStmtAsm.cpp
@@ -561,7 +561,10 @@ LabelDecl *Sema::GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
LabelDecl* Label = LookupOrCreateLabel(PP.getIdentifierInfo(ExternalLabelName),
Location);
- if (!Label->isMSAsmLabel()) {
+ if (Label->isMSAsmLabel()) {
+ // If we have previously created this label implicitly, mark it as used.
+ Label->markUsed(Context);
+ } else {
// Otherwise, insert it, but only resolve it if we have seen the label itself.
std::string InternalName;
llvm::raw_string_ostream OS(InternalName);
OpenPOWER on IntegriCloud