From f2f669414fae41fc791d4943a1446db61b30912f Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 19 Dec 2023 18:57:07 +0100 Subject: llvm-orc-jit: migrate to my latest clang-format --- content/2022-07-07-llvm-orc-jit/.clang-format | 102 ++------------------------ content/2022-07-07-llvm-orc-jit/jit.h | 21 +++--- 2 files changed, 18 insertions(+), 105 deletions(-) (limited to 'content/2022-07-07-llvm-orc-jit') diff --git a/content/2022-07-07-llvm-orc-jit/.clang-format b/content/2022-07-07-llvm-orc-jit/.clang-format index 784ecf3..0922593 100644 --- a/content/2022-07-07-llvm-orc-jit/.clang-format +++ b/content/2022-07-07-llvm-orc-jit/.clang-format @@ -1,104 +1,14 @@ # dotfiles -- clang-format # author: johannst # doc : https://clang.llvm.org/docs/ClangFormatStyleOptions.html +--- Language: Cpp -Standard: Auto +BasedOnStyle: Chromium + +AllowShortFunctionsOnASingleLine: None AccessModifierOffset: -2 -AlignAfterOpenBracket: Align +IndentWidth: 2 + AlignConsecutiveMacros: true -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -AlignEscapedNewlines: Left -AlignOperands: true -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: true -AllowAllConstructorInitializersOnNextLine: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: Never -AllowShortLambdasOnASingleLine: All -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: true -AlwaysBreakTemplateDeclarations: Yes -BinPackArguments: true -BinPackParameters: true -BreakBeforeBraces: Custom -BraceWrapping: - AfterCaseLabel: false - AfterClass: false - AfterControlStatement: false - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterStruct: false - AfterUnion: false - AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: true - SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: AfterColon -BreakConstructorInitializersBeforeComma: false -BreakInheritanceList: BeforeColon -BreakBeforeInheritanceComma: false -BreakStringLiterals: true -ColumnLimit: 80 -CompactNamespaces: true -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 0 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true -IncludeBlocks: Preserve -# Could use `IncludeCategories` to define rules for includes -IndentCaseLabels: true -IndentPPDirectives: AfterHash -IndentWidth: 2 -IndentWrappedFunctionNames: false -KeepEmptyLinesAtTheStartOfBlocks: false -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 2 -NamespaceIndentation: Inner -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyBreakTemplateDeclaration: 10 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerAlignment: Left -ReflowComments: true -SortIncludes: true -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatements -SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInContainerLiterals: true -SpacesInParentheses: false -SpacesInSquareBrackets: false -TabWidth: 4 -UseTab: Never diff --git a/content/2022-07-07-llvm-orc-jit/jit.h b/content/2022-07-07-llvm-orc-jit/jit.h index 9ac7b0a..23cec42 100644 --- a/content/2022-07-07-llvm-orc-jit/jit.h +++ b/content/2022-07-07-llvm-orc-jit/jit.h @@ -52,15 +52,18 @@ private: JITDylib& JD; public: - Jit(std::unique_ptr ES, JITTargetMachineBuilder JTMB, - DataLayout DL) : - ES(std::move(ES)), - DL(std::move(DL)), Mangle(*this->ES, this->DL), - ObjectLayer(*this->ES, - []() { return std::make_unique(); }), - CompileLayer(*this->ES, ObjectLayer, - std::make_unique(std::move(JTMB))), - JD(this->ES->createBareJITDylib("main")) { + Jit(std::unique_ptr ES, + JITTargetMachineBuilder JTMB, + DataLayout DL) + : ES(std::move(ES)), + DL(std::move(DL)), + Mangle(*this->ES, this->DL), + ObjectLayer(*this->ES, + []() { return std::make_unique(); }), + CompileLayer(*this->ES, + ObjectLayer, + std::make_unique(std::move(JTMB))), + JD(this->ES->createBareJITDylib("main")) { // https://www.llvm.org/docs/ORCv2.html#how-to-add-process-and-library-symbols-to-jitdylibs // JD.addGenerator( // cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( -- cgit v1.2.3