From 36c201a65af69f3bba9fc55ef28eae7500cde63c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 7 Dec 2016 00:17:18 +0000 Subject: [PATCH] Address review feedback by adding comments about ${:uid} llvm-svn: 288868 --- clang/lib/Sema/SemaStmtAsm.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index 0064a2c5121d..9a1824498456 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -750,9 +750,11 @@ LabelDecl *Sema::GetOrCreateMSAsmLabel(StringRef ExternalLabelName, // Otherwise, insert it, but only resolve it if we have seen the label itself. std::string InternalName; llvm::raw_string_ostream OS(InternalName); - // Create an internal name for the label. The name should not be a valid mangled - // name, and should be unique. We use a dot to make the name an invalid mangled - // name. + // Create an internal name for the label. The name should not be a valid + // mangled name, and should be unique. We use a dot to make the name an + // invalid mangled name. We use LLVM's inline asm ${:uid} escape so that a + // unique label is generated each time this blob is emitted, even after + // inlining or LTO. OS << "__MSASMLABEL_.${:uid}__"; for (char C : ExternalLabelName) { OS << C;