Skip to content

Commit

Permalink
Formats the code with clang-format and my additional stylistic mojojo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Goodman authored Aug 5, 2020
1 parent 3d9c121 commit c002b85
Show file tree
Hide file tree
Showing 60 changed files with 3,872 additions and 3,152 deletions.
69 changes: 69 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
BasedOnStyle: Google
AccessModifierOffset: '-1'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'false'
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: DontAlign
AlignOperands: 'true'
AlignTrailingComments: 'false'
AllowAllArgumentsOnNextLine: 'true'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackParameters: 'true'
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: 'false'
ColumnLimit: '80'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'true'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentWidth: '2'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
Language: Cpp
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: None
PointerAlignment: Right
ReflowComments: 'false'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '2'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '2'
UseTab: Never
PenaltyReturnTypeOnItsOwnLine: '40'

...
2 changes: 1 addition & 1 deletion .remill_commit_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e26fea16bb5a04f700cee590af8d810b916461a7
99df2e19d4c4af677948a851461e9ffb3c164331
17 changes: 6 additions & 11 deletions mcsema/Arch/Arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,21 @@
#include "mcsema/Arch/Arch.h"

#include <glog/logging.h>

#include <unordered_set>

#include <llvm/ADT/ArrayRef.h>

#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/Constants.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/Instruction.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Type.h>

#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/TargetRegistry.h>
#include <llvm/Support/TargetSelect.h>

#include <llvm/Support/raw_ostream.h>
#include <remill/Arch/Arch.h>

#include <unordered_set>

#include "mcsema/BC/Util.h"

namespace mcsema {
Expand All @@ -46,12 +42,11 @@ extern std::shared_ptr<llvm::LLVMContext> gContext;
std::unique_ptr<const remill::Arch> gArch(nullptr);

bool InitArch(const std::string &os, const std::string &arch) {
LOG(INFO)
<< "Initializing for " << arch << " code on " << os;
LOG(INFO) << "Initializing for " << arch << " code on " << os;

remill::Arch::GetTargetArch(*gContext).swap(gArch);
gWordType = llvm::Type::getIntNTy(
*gContext, static_cast<unsigned>(gArch->address_size));
gWordType = llvm::Type::getIntNTy(*gContext,
static_cast<unsigned>(gArch->address_size));

gWordMask = 0;
if (32 == gArch->address_size) {
Expand Down
Loading

0 comments on commit c002b85

Please sign in to comment.