[PATCH] D38458: Fix assertion failure in thread safety analysis (PR34800).

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 07:26:49 PDT 2017


alexfh added inline comments.


================
Comment at: include/clang/Analysis/Analyses/ThreadSafetyTIL.h:931-936
+    if (!SlotName) {
+      std::string Buffer;
+      llvm::raw_string_ostream OS(Buffer);
+      Cvdecl->printName(OS);
+      SlotName = OS.str();
+    }
----------------
BTW, alternatively, I could do:
```
     if (!SlotName) {
       SlotName = "";
       llvm::raw_string_ostream OS(*SlotName);
       Cvdecl->printName(OS);
     }
```

Not sure which of these would be preferred in this code.


https://reviews.llvm.org/D38458





More information about the cfe-commits mailing list