Skip to content

[CIR] Upstream pointer subtraction handling #162360

@andykaylor

Description

@andykaylor

Overview

Upstream support for subtracting pointer values using the cir.ptr_diff operation. This will also require upstreaming the code to lower cir.ptr_diff to LLVM IR.

Suggested minimal test case

unsigned long long test_ptr_diff(int *a, int* b) {
  return a - b;
}

Existing incubator tests

clang/test/CIR/CodeGen/ptrdiff.c
clang/test/CIR/CodeGen/ptrdiff.cpp

Metadata

Metadata

Assignees

Labels

ClangIRAnything related to the ClangIR project

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions