[llvm-branch-commits] [llvm] [KeyInstr] Add Atom Group waterline to LLVMContext (PR #133478)

Jeremy Morse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 10 07:34:16 PDT 2025


================
@@ -1366,6 +1367,43 @@ TEST_F(DILocationTest, discriminatorSpecialCases) {
   EXPECT_EQ(std::nullopt, L4->cloneByMultiplyingDuplicationFactor(0x1000));
 }
 
+TEST_F(DILocationTest, KeyInstructions) {
+  Context.pImpl->NextAtomGroup = 1;
+
+  EXPECT_EQ(Context.pImpl->NextAtomGroup, 1u);
+  DILocation *A1 = DILocation::get(Context, 1, 0, getSubprogram(), nullptr, false, 1, 2);
+  // The group is only applied to the DILocation if the build has opted into
+  // the additional DILocation fields needed for the feature.
----------------
jmorse wrote:

Style nit: I feel "the build has opted into" is a bit too abstract, and is like the code referring to itself in the third person. "if we have been built with..." feels a lot cleaner IMHO, YMMV.

https://github.com/llvm/llvm-project/pull/133478


More information about the llvm-branch-commits mailing list