[llvm] r346727 - [BuildingAJIT] Clang-format chapters 1 and 2.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 12 17:26:26 PST 2018
Author: lhames
Date: Mon Nov 12 17:26:25 2018
New Revision: 346727
URL: http://llvm.org/viewvc/llvm-project?rev=346727&view=rev
Log:
[BuildingAJIT] Clang-format chapters 1 and 2.
Modified:
llvm/trunk/docs/tutorial/BuildingAJIT2.rst
llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
Modified: llvm/trunk/docs/tutorial/BuildingAJIT2.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/BuildingAJIT2.rst?rev=346727&r1=346726&r2=346727&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/BuildingAJIT2.rst (original)
+++ llvm/trunk/docs/tutorial/BuildingAJIT2.rst Mon Nov 12 17:26:25 2018
@@ -99,8 +99,8 @@ Next we need to update our addModule met
.. 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());
Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp?rev=346727&r1=346726&r2=346727&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Mon Nov 12 17:26:25 2018
@@ -679,9 +679,8 @@ static std::unique_ptr<FunctionAST> Pars
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");
Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h?rev=346727&r1=346726&r2=346727&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h Mon Nov 12 17:26:25 2018
@@ -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());
Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp?rev=346727&r1=346726&r2=346727&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Mon Nov 12 17:26:25 2018
@@ -679,9 +679,8 @@ static std::unique_ptr<FunctionAST> Pars
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");
More information about the llvm-commits
mailing list