1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef jit_AliasAnalysis_h
8 #define jit_AliasAnalysis_h
11 #include "jit/MIRGraph.h"
23 void spewDependencyList();
25 TempAllocator
& alloc() const { return graph_
.alloc(); }
28 AliasAnalysis(MIRGenerator
* mir
, MIRGraph
& graph
)
29 : mir(mir
), graph_(graph
), loop_(nullptr) {}
31 [[nodiscard
]] bool analyze();
34 // Iterates over the flags in an AliasSet.
35 class AliasSetIterator
{
41 explicit AliasSetIterator(AliasSet set
) : flags(set
.flags()), pos(0) {
42 while (flags
&& (flags
& 1) == 0) {
47 AliasSetIterator
& operator++(int) {
51 } while (flags
&& (flags
& 1) == 0);
54 explicit operator bool() const { return !!flags
; }
55 unsigned operator*() const {
56 MOZ_ASSERT(pos
< AliasSet::NumCategories
);
64 #endif /* jit_AliasAnalysis_h */