Skip to content

Commit

Permalink
[clang][Interp][NFC] Move CastKind operator<< to PrimTypes.h
Browse files Browse the repository at this point in the history
So it actually works when using dump().
  • Loading branch information
tbaederr committed Jul 26, 2023
1 parent 73362c4 commit 4744693
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 0 additions & 9 deletions clang/lib/AST/Interp/Disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,3 @@ LLVM_DUMP_METHOD void Program::dump(llvm::raw_ostream &OS) const {
Anon->dump();
}
}

llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, interp::CastKind CK) {
switch (CK) {
case interp::CastKind::Reinterpret:
OS << "reinterpret_cast";
break;
}
return OS;
}
10 changes: 9 additions & 1 deletion clang/lib/AST/Interp/PrimType.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ enum PrimType : unsigned {
enum class CastKind : uint8_t {
Reinterpret,
};
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, interp::CastKind CK);
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
interp::CastKind CK) {
switch (CK) {
case interp::CastKind::Reinterpret:
OS << "reinterpret_cast";
break;
}
return OS;
}

constexpr bool isIntegralType(PrimType T) { return T <= PT_Uint64; }

Expand Down

0 comments on commit 4744693

Please sign in to comment.