[llvm] [ASan] Optionally emit DInfo for inserted sanitization calls (PR #191548)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 15:11:13 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index d0162bc27..65e8b45eb 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1318,8 +1318,9 @@ struct AsanCallbackInfo {
 };
 
 // Table of all ASan callbacks with per-argument type annotations.
-// Some prefixes are themselves prefixes of others (prefix A is the prefix of prefix B).
-// We place prefix B first to avoid having a function name matching B from matching A instead.
+// Some prefixes are themselves prefixes of others (prefix A is the prefix of
+// prefix B). We place prefix B first to avoid having a function name matching B
+// from matching A instead.
 static constexpr auto Void = AsanArgType::Void;
 static constexpr auto Int = AsanArgType::Int;
 static constexpr auto VoidPtr = AsanArgType::VoidPtr;
@@ -1364,7 +1365,8 @@ static const AsanCallbackInfo *lookupAsanCallback(StringRef Name) {
 }
 
 /// Create the pointee DIType for a pointer-typed ASan callback argument.
-/// List is exhaustive for the current set of callbacks (void *, __u8 *, __uintptr).
+/// List is exhaustive for the current set of callbacks (void *, __u8 *,
+/// __uintptr).
 static DIType *solveAsanPointeeType(DIBuilder &DIB, AsanArgType ArgType,
                                     unsigned PtrBitWidth) {
   switch (ArgType) {
@@ -1441,10 +1443,10 @@ static void emitAsanDebugInfo(Module &M) {
     DISubroutineType *SubTy =
         DIB.createSubroutineType(DIB.getOrCreateTypeArray(ParamTypes));
 
-    DISubprogram *SP = DIB.createFunction(
-        File, F.getName(), F.getName(), File, 0, SubTy,
-        0, DINode::FlagArtificial | DINode::FlagPrototyped,
-        DISubprogram::SPFlagZero);
+    DISubprogram *SP =
+        DIB.createFunction(File, F.getName(), F.getName(), File, 0, SubTy, 0,
+                           DINode::FlagArtificial | DINode::FlagPrototyped,
+                           DISubprogram::SPFlagZero);
 
     F.setSubprogram(SP);
   }

``````````

</details>


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


More information about the llvm-commits mailing list