[PATCH] Diagnose jumping from one MS inline assembly block to another.

Ehsan Akhgari ehsan.akhgari at gmail.com
Mon Sep 29 11:00:48 PDT 2014


================
Comment at: lib/Sema/JumpDiagnostics.cpp:496
@@ -487,1 +495,3 @@
 void JumpScopeChecker::VerifyJumps() {
+  std::map<StringRef, MSAsmStmt*> LabelProvider;
+  for (Stmt *J : Jumps) {
----------------
rnk wrote:
> At a high level, I feel like we shouldn't need this map. It basically reinvents the label name lookup that sema is already performing for us.
> 
> What if we changed LabelDecl to hold an MSAsmStmt*? Conceptually, we could make TheStmt be a Stmt* and getStmt() could be 'return dyn_cast_or_null<LabelStmt>(TheStmt);'.
How do we get the corresponding MSAsmStmt* though?  LookupInlineAsmLabel doesn't have access to that information.

http://reviews.llvm.org/D5516






More information about the cfe-commits mailing list