LLVM 20.0.0git
ModRef.cpp
Go to the documentation of this file.
1//===--- ModRef.cpp - Memory effect modeling --------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements ModRef and MemoryEffects misc functions.
10//
11//===----------------------------------------------------------------------===//
12
13#include "llvm/Support/ModRef.h"
14#include "llvm/ADT/STLExtras.h"
15
16using namespace llvm;
17
19 switch (MR) {
20 case ModRefInfo::NoModRef:
21 OS << "NoModRef";
22 break;
23 case ModRefInfo::Ref:
24 OS << "Ref";
25 break;
26 case ModRefInfo::Mod:
27 OS << "Mod";
28 break;
29 case ModRefInfo::ModRef:
30 OS << "ModRef";
31 break;
32 }
33 return OS;
34}
35
38 switch (Loc) {
39 case IRMemLocation::ArgMem:
40 OS << "ArgMem: ";
41 break;
42 case IRMemLocation::InaccessibleMem:
43 OS << "InaccessibleMem: ";
44 break;
45 case IRMemLocation::Other:
46 OS << "Other: ";
47 break;
48 }
49 OS << ME.getModRef(Loc);
50 });
51 return OS;
52}
This file contains some templates that are useful if you are working with the STL at all.
raw_pwrite_stream & OS
ModRefInfo getModRef(Location Loc) const
Get ModRefInfo for the given Location.
Definition: ModRef.h:165
static auto locations()
Returns iterator over all supported location kinds.
Definition: ModRef.h:95
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void interleaveComma(const Container &c, StreamT &os, UnaryFunctor each_fn)
Definition: STLExtras.h:2207
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
Definition: ModRef.h:27
IRMemLocation
The locations at which a function might access memory.
Definition: ModRef.h:59
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:303