diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-binop-overflow.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-binop-overflow.c index 37d3809819a89..3b74ba5968073 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-binop-overflow.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-binop-overflow.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -fbounds-safety -Os %s -triple arm64-apple-iphoneos -emit-llvm -o %t-Os.s -opt-record-file %t-Os.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-Os.opt.yaml --check-prefixes OPT-REM %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-ptr-induction.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-ptr-induction.c index 1b9f2420fbad9..f8e577b9d80b0 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-ptr-induction.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-missed-ptr-induction.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -fbounds-safety -Os %s -triple arm64-apple-iphoneos -emit-llvm -o %t-Os.s -opt-record-file %t-Os.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-Os.opt.yaml --check-prefixes OPT-REM %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O0.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O0.c index 3efdd6f890465..6d4d7fc961c4e 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O0.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O0.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -triple x86_64-apple-macos -Wno-bounds-safety-init-list -fbounds-safety -O0 %s -emit-llvm -o %t-O0.s -opt-record-file %t-O0.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-O0.s --check-prefixes IR %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O2.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O2.c index 0827e6bbee46e..2f8321344ee2a 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O2.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O2.c @@ -106,7 +106,7 @@ int main(int argc, char **argv) { // OPT-REM-NEXT: Pass: annotation-remarks // OPT-REM-NEXT: Name: BoundsSafetyCheck // OPT-REM-NEXT: DebugLoc: { File: '{{.*}}bounds-safety-ptr-conversion-O2.c', -// OPT-REM-NEXT: Line: 0, Column: 0 } +// OPT-REM-NEXT: Line: 12, Column: 25 } // OPT-REM-NEXT: Function: main // OPT-REM-NEXT: Args: // OPT-REM-NEXT: - String: 'Inserted ' @@ -115,20 +115,20 @@ int main(int argc, char **argv) { // OPT-REM-NEXT: - String: s // OPT-REM-NEXT: - String: "\n" // OPT-REM-NEXT: - String: "used for:\n" -// OPT-REM-NEXT: - String: bounds-safety-generic, bounds-safety-check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound +// OPT-REM-NEXT: - String: bounds-safety-check-ptr-neq-null // OPT-REM-NEXT: - String: | // OPT-REM-NEXT: {{^[ ]+$}} // OPT-REM-NEXT: {{^[ ]+$}} // OPT-REM-NEXT: instructions: // OPT-REM-EMPTY: -// OPT-REM-NEXT: - String: "trap (LLVM IR 'call')\nother (LLVM IR 'unreachable')" +// OPT-REM-NEXT: - String: "cmp eq (LLVM IR 'icmp')\ncond branch (LLVM IR 'br')" // OPT-REM-NEXT: ... // OPT-REM-NEXT: --- !Analysis // OPT-REM-NEXT: Pass: annotation-remarks // OPT-REM-NEXT: Name: BoundsSafetyCheck // OPT-REM-NEXT: DebugLoc: { File: '{{.*}}bounds-safety-ptr-conversion-O2.c', -// OPT-REM-NEXT: Line: 12, Column: 25 } +// OPT-REM-NEXT: Line: 0, Column: 0 } // OPT-REM-NEXT: Function: main // OPT-REM-NEXT: Args: // OPT-REM-NEXT: - String: 'Inserted ' @@ -137,13 +137,13 @@ int main(int argc, char **argv) { // OPT-REM-NEXT: - String: s // OPT-REM-NEXT: - String: "\n" // OPT-REM-NEXT: - String: "used for:\n" -// OPT-REM-NEXT: - String: bounds-safety-check-ptr-neq-null +// OPT-REM-NEXT: - String: bounds-safety-generic, bounds-safety-check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound // OPT-REM-NEXT: - String: | // OPT-REM-NEXT: {{^[ ]+$}} // OPT-REM-NEXT: {{^[ ]+$}} // OPT-REM-NEXT: instructions: // OPT-REM-EMPTY: -// OPT-REM-NEXT: - String: "cmp eq (LLVM IR 'icmp')\ncond branch (LLVM IR 'br')" +// OPT-REM-NEXT: - String: "trap (LLVM IR 'call')\nother (LLVM IR 'unreachable')" // OPT-REM-NEXT: ... // OPT-REM-NOT: --- !Analysis diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-argc-O0.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-argc-O0.c index 19e87acdc53ac..aa3c032407ac8 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-argc-O0.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-argc-O0.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -fbounds-safety -O0 %s -emit-llvm -o %t-O0.s -opt-record-file %t-O0.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-O0.s --check-prefixes IR %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-const-O0.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-const-O0.c index 85eef83797b57..2baa2878dfcd3 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-const-O0.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-bounds-const-O0.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -fbounds-safety -O0 %s -emit-llvm -o %t-O0.s -opt-record-file %t-O0.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-O0.s --check-prefixes IR %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-argc-O0.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-argc-O0.c index 1909427f28178..ee1b9a150c2a2 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-argc-O0.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-argc-O0.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -triple x86_64-apple-macos -fbounds-safety -O0 %s -emit-llvm -o %t-O0.s -opt-record-file %t-O0.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-O0.s --check-prefixes IR %s diff --git a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-const-O0.c b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-const-O0.c index 6567544b5a0fb..7d9404a5745ca 100644 --- a/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-const-O0.c +++ b/clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-const-O0.c @@ -1,4 +1,4 @@ -// XFAIL: * + // RUN: %clang_cc1 -triple x86_64-apple-macos -fbounds-safety -O0 %s -emit-llvm -o %t-O0.s -opt-record-file %t-O0.opt.yaml -opt-record-format yaml // RUN: FileCheck --input-file %t-O0.s --check-prefixes IR %s diff --git a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp index 7f0be8a959324..7f6ddfe4e258c 100644 --- a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp +++ b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp @@ -133,7 +133,7 @@ static void runImpl(Function &F, const TargetLibraryInfo &TLI) { return; // Track all annotated instructions aggregated based on their debug location. - DenseMap> DebugLoc2Annotated; + MapVector> DebugLoc2Annotated; OptimizationRemarkEmitter ORE(&F); // First, generate a summary of the annotated instructions.