diff options
author | Lang Hames <lhames@gmail.com> | 2018-11-13 01:26:25 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2018-11-13 01:26:25 +0000 |
commit | 8bf69be1c1805a8fdde0880da959133aca623e9a (patch) | |
tree | 59bec462f8cbc71837c9b9c163b83391b3877f65 /llvm/examples | |
parent | 575515fddf9003c0a5f680c52bfa9893ceb4c20c (diff) | |
download | bcm5719-llvm-8bf69be1c1805a8fdde0880da959133aca623e9a.tar.gz bcm5719-llvm-8bf69be1c1805a8fdde0880da959133aca623e9a.zip |
[BuildingAJIT] Clang-format chapters 1 and 2.
llvm-svn: 346727
Diffstat (limited to 'llvm/examples')
3 files changed, 7 insertions, 12 deletions
diff --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp index 5a66b367c27..76162ae444d 100644 --- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp +++ b/llvm/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/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h index 1060256ec0d..4dc08470dff 100644 --- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h +++ b/llvm/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/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp index 5a66b367c27..76162ae444d 100644 --- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp +++ b/llvm/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"); |