diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 5 |
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); |