diff options
author | Antonio Frighetto <me@antoniofrighetto.com> | 2025-02-10 15:30:35 +0100 |
---|---|---|
committer | Antonio Frighetto <me@antoniofrighetto.com> | 2025-02-13 12:13:39 +0100 |
commit | ff585feacf58b384d7525d2b1368298435132fb4 (patch) | |
tree | d23f040a7be7146e69ca7681449113b8a82cfe66 /llvm/lib/IR/Attributes.cpp | |
parent | eef02053459a0eb3076b0db76555f9836ac90b07 (diff) | |
download | llvm-ff585feacf58b384d7525d2b1368298435132fb4.zip llvm-ff585feacf58b384d7525d2b1368298435132fb4.tar.gz llvm-ff585feacf58b384d7525d2b1368298435132fb4.tar.bz2 |
[IR][ModRef] Introduce `errno` memory location
Model C/C++ `errno` macro by adding a corresponding `errno`
memory location kind to the IR. Preliminary work to separate
`errno` writes from other memory accesses, to the benefit of
alias analyses and optimization correctness.
Previous discussion: https://discourse.llvm.org/t/rfc-modelling-errno-memory-effects/82972.
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index ef0591e..8da1dfe 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -647,6 +647,9 @@ std::string Attribute::getAsString(bool InAttrGrp) const { case IRMemLocation::InaccessibleMem: OS << "inaccessiblemem: "; break; + case IRMemLocation::ErrnoMem: + OS << "errnomem: "; + break; case IRMemLocation::Other: llvm_unreachable("This is represented as the default access kind"); } |