aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-11-13 01:26:25 +0000
committerLang Hames <lhames@gmail.com>2018-11-13 01:26:25 +0000
commit30b44ffb4c108e9d73938fb19889b3217b01e543 (patch)
tree684290e8d47b2a1c95a0a4446ece076f986949c3
parent94419b4f02758ceaddf38a380486cb4c45b0da5b (diff)
[BuildingAJIT] Clang-format chapters 1 and 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346727 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/tutorial/BuildingAJIT2.rst4
-rw-r--r--examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp7
-rw-r--r--examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h5
-rw-r--r--examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp7
4 files changed, 9 insertions, 14 deletions
diff --git a/docs/tutorial/BuildingAJIT2.rst b/docs/tutorial/BuildingAJIT2.rst
index 902382adf89..7d25ccaba0a 100644
--- a/docs/tutorial/BuildingAJIT2.rst
+++ b/docs/tutorial/BuildingAJIT2.rst
@@ -99,8 +99,8 @@ Next we need to update our addModule method to replace the call to
.. code-block:: c++
- ThreadSafeModule optimizeModule(ThreadSafeModule M,
- const MaterializationResponsibility &R) {
+ static Expected<ThreadSafeModule>
+ optimizeModule(ThreadSafeModule M, const MaterializationResponsibility &R) {
// Create a function pass manager.
auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
index 5a66b367c27..76162ae444d 100644
--- a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
+++ b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
@@ -679,9 +679,8 @@ static std::unique_ptr<FunctionAST> ParseDefinition() {
static std::unique_ptr<FunctionAST> ParseTopLevelExpr(unsigned ExprCount) {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>(("__anon_expr" +
- Twine(ExprCount)).str(),
- std::vector<std::string>());
+ auto Proto = llvm::make_unique<PrototypeAST>
+ ("__anon_expr" + Twine(ExprCount)).str(), std::vector<std::string>());
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
@@ -1157,7 +1156,7 @@ static void HandleTopLevelExpression() {
// Get the anonymous expression's JITSymbol.
auto Sym =
- ExitOnErr(TheJIT->lookup(("__anon_expr" + Twine(ExprCount)).str()));
+ ExitOnErr(TheJIT->lookup(("__anon_expr" + Twine(ExprCount)).str()));
auto *FP = (double (*)())(intptr_t)Sym.getAddress();
assert(FP && "Failed to codegen function");
diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
index 1060256ec0d..4dc08470dff 100644
--- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
+++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
@@ -47,7 +47,6 @@ private:
ThreadSafeContext Ctx;
public:
-
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
: ObjectLayer(ES,
[]() { return llvm::make_unique<SectionMemoryManager>(); }),
@@ -86,10 +85,8 @@ public:
}
private:
-
static Expected<ThreadSafeModule>
- optimizeModule(ThreadSafeModule TSM,
- const MaterializationResponsibility &R) {
+ optimizeModule(ThreadSafeModule TSM, const MaterializationResponsibility &R) {
// Create a function pass manager.
auto FPM = llvm::make_unique<legacy::FunctionPassManager>(TSM.getModule());
diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
index 5a66b367c27..76162ae444d 100644
--- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
+++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
@@ -679,9 +679,8 @@ static std::unique_ptr<FunctionAST> ParseDefinition() {
static std::unique_ptr<FunctionAST> ParseTopLevelExpr(unsigned ExprCount) {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>(("__anon_expr" +
- Twine(ExprCount)).str(),
- std::vector<std::string>());
+ auto Proto = llvm::make_unique<PrototypeAST>
+ ("__anon_expr" + Twine(ExprCount)).str(), std::vector<std::string>());
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
@@ -1157,7 +1156,7 @@ static void HandleTopLevelExpression() {
// Get the anonymous expression's JITSymbol.
auto Sym =
- ExitOnErr(TheJIT->lookup(("__anon_expr" + Twine(ExprCount)).str()));
+ ExitOnErr(TheJIT->lookup(("__anon_expr" + Twine(ExprCount)).str()));
auto *FP = (double (*)())(intptr_t)Sym.getAddress();
assert(FP && "Failed to codegen function");