Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llvm/include/llvm/IR/FMF.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ifndef LLVM_IR_FMF_H
#define LLVM_IR_FMF_H

#include "llvm/ADT/Hashing.h"
#include "llvm/Support/Compiler.h"

namespace llvm {
Expand Down Expand Up @@ -121,6 +122,9 @@ class FastMathFlags {
const unsigned ValueMask = NoNaNs | NoInfs | NoSignedZeros;
return FastMathFlags(ValueMask & (LHS.Flags | RHS.Flags));
}

// Hashing.
friend hash_code hash_value(const FastMathFlags &FMF);
};

inline FastMathFlags operator|(FastMathFlags LHS, FastMathFlags RHS) {
Expand All @@ -138,6 +142,9 @@ inline raw_ostream &operator<<(raw_ostream &O, FastMathFlags FMF) {
return O;
}

inline hash_code hash_value(const FastMathFlags &FMF) {
return hash_value(FMF.Flags);
}
} // end namespace llvm

#endif // LLVM_IR_FMF_H
7 changes: 7 additions & 0 deletions llvm/include/llvm/IR/GEPNoWrapFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ifndef LLVM_IR_GEPNOWRAPFLAGS_H
#define LLVM_IR_GEPNOWRAPFLAGS_H

#include "llvm/ADT/Hashing.h"
#include <assert.h>

namespace llvm {
Expand Down Expand Up @@ -101,8 +102,14 @@ class GEPNoWrapFlags {
Flags |= Other.Flags;
return *this;
}

// Hashing.
friend hash_code hash_value(const GEPNoWrapFlags &NW);
};

inline hash_code hash_value(const GEPNoWrapFlags &NW) {
return hash_value(NW.Flags);
}
} // end namespace llvm

#endif // LLVM_IR_GEPNOWRAPFLAGS_H
Loading