Skip to content

Commit a07aba5

Browse files
authored
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse this.
1 parent ef6e7af commit a07aba5

File tree

127 files changed

+198
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+198
-167
lines changed

clang/docs/ClangFormattedStatus.rst

Lines changed: 1 addition & 1 deletion

clang/docs/tools/clang-formatted-files.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -322,24 +322,24 @@ clang/lib/APINotes/APINotesTypes.cpp
322322
clang/lib/APINotes/APINotesYAMLCompiler.cpp
323323
clang/lib/AST/DataCollection.cpp
324324
clang/lib/AST/Linkage.h
325-
clang/lib/AST/Interp/ByteCodeGenError.cpp
326-
clang/lib/AST/Interp/ByteCodeGenError.h
327-
clang/lib/AST/Interp/Context.cpp
328-
clang/lib/AST/Interp/Context.h
329-
clang/lib/AST/Interp/Descriptor.cpp
330-
clang/lib/AST/Interp/Disasm.cpp
331-
clang/lib/AST/Interp/EvalEmitter.h
332-
clang/lib/AST/Interp/Frame.cpp
333-
clang/lib/AST/Interp/Frame.h
334-
clang/lib/AST/Interp/InterpState.h
335-
clang/lib/AST/Interp/Opcode.h
336-
clang/lib/AST/Interp/Pointer.cpp
337-
clang/lib/AST/Interp/PrimType.cpp
338-
clang/lib/AST/Interp/Record.h
339-
clang/lib/AST/Interp/Source.cpp
340-
clang/lib/AST/Interp/Source.h
341-
clang/lib/AST/Interp/State.cpp
342-
clang/lib/AST/Interp/State.h
325+
clang/lib/AST/ByteCode/ByteCodeGenError.cpp
326+
clang/lib/AST/ByteCode/ByteCodeGenError.h
327+
clang/lib/AST/ByteCode/Context.cpp
328+
clang/lib/AST/ByteCode/Context.h
329+
clang/lib/AST/ByteCode/Descriptor.cpp
330+
clang/lib/AST/ByteCode/Disasm.cpp
331+
clang/lib/AST/ByteCode/EvalEmitter.h
332+
clang/lib/AST/ByteCode/Frame.cpp
333+
clang/lib/AST/ByteCode/Frame.h
334+
clang/lib/AST/ByteCode/InterpState.h
335+
clang/lib/AST/ByteCode/Opcode.h
336+
clang/lib/AST/ByteCode/Pointer.cpp
337+
clang/lib/AST/ByteCode/PrimType.cpp
338+
clang/lib/AST/ByteCode/Record.h
339+
clang/lib/AST/ByteCode/Source.cpp
340+
clang/lib/AST/ByteCode/Source.h
341+
clang/lib/AST/ByteCode/State.cpp
342+
clang/lib/AST/ByteCode/State.h
343343
clang/lib/ASTMatchers/GtestMatchers.cpp
344344
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
345345
clang/lib/Basic/Attributes.cpp

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "clang/AST/ASTContext.h"
14+
#include "ByteCode/Context.h"
1415
#include "CXXABI.h"
15-
#include "Interp/Context.h"
1616
#include "clang/AST/APValue.h"
1717
#include "clang/AST/ASTConcept.h"
1818
#include "clang/AST/ASTMutationListener.h"

clang/lib/AST/Interp/Boolean.h renamed to clang/lib/AST/ByteCode/Boolean.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
#ifndef LLVM_CLANG_AST_INTERP_BOOLEAN_H
1010
#define LLVM_CLANG_AST_INTERP_BOOLEAN_H
1111

12-
#include <cstddef>
13-
#include <cstdint>
1412
#include "Integral.h"
1513
#include "clang/AST/APValue.h"
1614
#include "clang/AST/ComparisonCategories.h"
1715
#include "llvm/ADT/APSInt.h"
1816
#include "llvm/Support/MathExtras.h"
1917
#include "llvm/Support/raw_ostream.h"
18+
#include <cstddef>
19+
#include <cstdint>
2020

2121
namespace clang {
2222
namespace interp {
2323

2424
/// Wrapper around boolean types.
2525
class Boolean final {
26-
private:
26+
private:
2727
/// Underlying boolean.
2828
bool V;
2929

30-
public:
30+
public:
3131
/// Zero-initializes a boolean.
3232
Boolean() : V(false) {}
3333
explicit Boolean(bool V) : V(V) {}
@@ -104,8 +104,7 @@ class Boolean final {
104104

105105
static Boolean zero() { return from(false); }
106106

107-
template <typename T>
108-
static Boolean from(T Value, unsigned NumBits) {
107+
template <typename T> static Boolean from(T Value, unsigned NumBits) {
109108
return Boolean(Value);
110109
}
111110

@@ -153,7 +152,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Boolean &B) {
153152
return OS;
154153
}
155154

156-
} // namespace interp
157-
} // namespace clang
155+
} // namespace interp
156+
} // namespace clang
158157

159158
#endif

clang/lib/AST/Interp/ByteCodeEmitter.cpp renamed to clang/lib/AST/ByteCode/ByteCodeEmitter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ void ByteCodeEmitter::emitLabel(LabelTy Label) {
206206
const size_t Target = Code.size();
207207
LabelOffsets.insert({Label, Target});
208208

209-
if (auto It = LabelRelocs.find(Label);
210-
It != LabelRelocs.end()) {
209+
if (auto It = LabelRelocs.find(Label); It != LabelRelocs.end()) {
211210
for (unsigned Reloc : It->second) {
212211
using namespace llvm::support;
213212

@@ -228,8 +227,7 @@ int32_t ByteCodeEmitter::getOffset(LabelTy Label) {
228227
assert(aligned(Position));
229228

230229
// If target is known, compute jump offset.
231-
if (auto It = LabelOffsets.find(Label);
232-
It != LabelOffsets.end())
230+
if (auto It = LabelOffsets.find(Label); It != LabelOffsets.end())
233231
return It->second - Position;
234232

235233
// Otherwise, record relocation and return dummy offset.
@@ -308,7 +306,8 @@ void emit(Program &P, std::vector<std::byte> &Code, const IntegralAP<true> &Val,
308306
}
309307

310308
template <typename... Tys>
311-
bool ByteCodeEmitter::emitOp(Opcode Op, const Tys &... Args, const SourceInfo &SI) {
309+
bool ByteCodeEmitter::emitOp(Opcode Op, const Tys &...Args,
310+
const SourceInfo &SI) {
312311
bool Success = true;
313312

314313
// The opcode is followed by arguments. The source info is

clang/lib/AST/Interp/ByteCodeEmitter.h renamed to clang/lib/AST/ByteCode/ByteCodeEmitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class ByteCodeEmitter {
9292

9393
/// Emits an opcode.
9494
template <typename... Tys>
95-
bool emitOp(Opcode Op, const Tys &... Args, const SourceInfo &L);
95+
bool emitOp(Opcode Op, const Tys &...Args, const SourceInfo &L);
9696

9797
protected:
9898
#define GET_LINK_PROTO

clang/lib/AST/Interp/Compiler.cpp renamed to clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,7 +3722,8 @@ bool Compiler<Emitter>::visitDeclAndReturn(const VarDecl *VD,
37223722
}
37233723

37243724
template <class Emitter>
3725-
VarCreationState Compiler<Emitter>::visitVarDecl(const VarDecl *VD, bool Toplevel) {
3725+
VarCreationState Compiler<Emitter>::visitVarDecl(const VarDecl *VD,
3726+
bool Toplevel) {
37263727
// We don't know what to do with these, so just return false.
37273728
if (VD->getType().isNull())
37283729
return false;
@@ -5124,7 +5125,7 @@ bool Compiler<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
51245125
if (!this->visit(SubExpr))
51255126
return false;
51265127
return DiscardResult ? this->emitPop(*T, E) : this->emitNeg(*T, E);
5127-
case UO_Plus: // +x
5128+
case UO_Plus: // +x
51285129
if (!T)
51295130
return this->emitError(E);
51305131

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)