Skip to content

Commit 094ab47

Browse files
committed
Revert "Reland [clang-repl] Introduce Value to capture expression results"
This reverts commit d71a4e0. See http://45.33.8.238/macm1/61024/step_7.txt
1 parent 7599381 commit 094ab47

File tree

12 files changed

+29
-1289
lines changed

12 files changed

+29
-1289
lines changed

clang/include/clang/Interpreter/Interpreter.h

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
#ifndef LLVM_CLANG_INTERPRETER_INTERPRETER_H
1515
#define LLVM_CLANG_INTERPRETER_INTERPRETER_H
1616

17-
#include "clang/AST/Decl.h"
18-
#include "clang/AST/GlobalDecl.h"
1917
#include "clang/Interpreter/PartialTranslationUnit.h"
20-
#include "clang/Interpreter/Value.h"
2118

22-
#include "llvm/ADT/DenseMap.h"
19+
#include "clang/AST/GlobalDecl.h"
20+
2321
#include "llvm/ExecutionEngine/JITSymbol.h"
2422
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
2523
#include "llvm/Support/Error.h"
24+
2625
#include <memory>
2726
#include <vector>
2827

@@ -55,26 +54,24 @@ class Interpreter {
5554
Interpreter(std::unique_ptr<CompilerInstance> CI, llvm::Error &Err);
5655

5756
llvm::Error CreateExecutor();
58-
unsigned InitPTUSize = 0;
59-
60-
// This member holds the last result of the value printing. It's a class
61-
// member because we might want to access it after more inputs. If no value
62-
// printing happens, it's in an invalid state.
63-
Value LastValue;
6457

6558
public:
6659
~Interpreter();
6760
static llvm::Expected<std::unique_ptr<Interpreter>>
6861
create(std::unique_ptr<CompilerInstance> CI);
69-
const ASTContext &getASTContext() const;
70-
ASTContext &getASTContext();
7162
const CompilerInstance *getCompilerInstance() const;
7263
llvm::Expected<llvm::orc::LLJIT &> getExecutionEngine();
7364

7465
llvm::Expected<PartialTranslationUnit &> Parse(llvm::StringRef Code);
7566
llvm::Error Execute(PartialTranslationUnit &T);
76-
llvm::Error ParseAndExecute(llvm::StringRef Code, Value *V = nullptr);
77-
llvm::Expected<llvm::orc::ExecutorAddr> CompileDtorCall(CXXRecordDecl *CXXRD);
67+
llvm::Error ParseAndExecute(llvm::StringRef Code) {
68+
auto PTU = Parse(Code);
69+
if (!PTU)
70+
return PTU.takeError();
71+
if (PTU->TheModule)
72+
return Execute(*PTU);
73+
return llvm::Error::success();
74+
}
7875

7976
/// Undo N previous incremental inputs.
8077
llvm::Error Undo(unsigned N = 1);
@@ -95,23 +92,6 @@ class Interpreter {
9592
/// file.
9693
llvm::Expected<llvm::orc::ExecutorAddr>
9794
getSymbolAddressFromLinkerName(llvm::StringRef LinkerName) const;
98-
99-
enum InterfaceKind { NoAlloc, WithAlloc, CopyArray };
100-
101-
const llvm::SmallVectorImpl<Expr *> &getValuePrintingInfo() const {
102-
return ValuePrintingInfo;
103-
}
104-
105-
Expr *SynthesizeExpr(Expr *E);
106-
107-
private:
108-
size_t getEffectivePTUSize() const;
109-
110-
bool FindRuntimeInterface();
111-
112-
llvm::DenseMap<CXXRecordDecl *, llvm::orc::ExecutorAddr> Dtors;
113-
114-
llvm::SmallVector<Expr *, 3> ValuePrintingInfo;
11595
};
11696
} // namespace clang
11797

clang/include/clang/Interpreter/Value.h

Lines changed: 0 additions & 202 deletions
This file was deleted.

clang/lib/Interpreter/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ add_clang_library(clangInterpreter
1414
IncrementalExecutor.cpp
1515
IncrementalParser.cpp
1616
Interpreter.cpp
17-
InterpreterUtils.cpp
18-
Value.cpp
1917

2018
DEPENDS
2119
intrinsics_gen

0 commit comments

Comments
 (0)