Skip to content

Commit

Permalink
Update metadata, clang-format
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 499202863
Change-Id: I821b5409a6afa28f6fbf790bf4e6d4b665c9912e
  • Loading branch information
cblichmann authored and copybara-github committed Jan 3, 2023
1 parent cd591f1 commit fc8cb88
Show file tree
Hide file tree
Showing 124 changed files with 169 additions and 200 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BinExport

Copyright 2011-2022 Google LLC.
Copyright 2011-2023 Google LLC.

[![Linux Build Status](https://github.com/google/binexport/workflows/linux-build/badge.svg)](https://github.com/google/binexport/actions?query=workflow%3Alinux-build)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/8977/badge.svg)](https://scan.coverity.com/projects/google-binexport)
Expand Down
2 changes: 1 addition & 1 deletion address_references.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion address_references.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion architectures.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
51 changes: 17 additions & 34 deletions base_types.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -45,42 +45,27 @@ void BaseType::SetName(const std::string& name) { name_ = name; }

const std::string& BaseType::GetName() const { return name_; }

void BaseType::SetSize(size_t size) {
size_ = size;
}
void BaseType::SetSize(size_t size) { size_ = size; }

size_t BaseType::GetSize() const {
return size_;
}
size_t BaseType::GetSize() const { return size_; }

void BaseType::SetSigned(bool is_signed) {
is_signed_ = is_signed;
}
void BaseType::SetSigned(bool is_signed) { is_signed_ = is_signed; }

bool BaseType::IsSigned() const {
return is_signed_;
}
bool BaseType::IsSigned() const { return is_signed_; }

void BaseType::SetPointer(const BaseType* pointer) {
pointer_ = pointer;
}
void BaseType::SetPointer(const BaseType* pointer) { pointer_ = pointer; }

const BaseType* BaseType::GetPointer() const {
return pointer_;
}
const BaseType* BaseType::GetPointer() const { return pointer_; }

void BaseType::AddMember(MemberType* member) {
members_.insert(std::lower_bound(members_.begin(),
members_.end(), member, &SortMemberTypes), member);
members_.insert(std::lower_bound(members_.begin(), members_.end(), member,
&SortMemberTypes),
member);
}

const BaseType::MemberTypes& BaseType::GetMembers() const {
return members_;
}
const BaseType::MemberTypes& BaseType::GetMembers() const { return members_; }

void BaseType::SetCategory(TypeCategory category) {
category_ = category;
}
void BaseType::SetCategory(TypeCategory category) { category_ = category; }

std::string BaseType::GetCategoryString() const {
switch (category_) {
Expand All @@ -103,8 +88,8 @@ std::string BaseType::GetCategoryString() const {
}

bool IsWithinMember(const MemberType* member, int offset) {
return offset >= member->offset
&& offset < member->offset + member->type->GetSize();
return offset >= member->offset &&
offset < member->offset + member->type->GetSize();
}

// Finds the member x in the struct that occupies space in the range
Expand All @@ -118,11 +103,9 @@ const MemberType* BaseType::ResolveMember(const BaseType* base_type,

MemberType search_member;
search_member.offset = offset;
MemberTypes::const_iterator cit =
std::lower_bound(base_type->GetMembers().begin(),
base_type->GetMembers().end(),
&search_member,
&SortMemberTypes);
MemberTypes::const_iterator cit = std::lower_bound(
base_type->GetMembers().begin(), base_type->GetMembers().end(),
&search_member, &SortMemberTypes);
// We might have found the subsequent member (since lower bound gives us the
// first member that is greater or equal regarding our search offset).
if (cit == base_type->GetMembers().end() || !IsWithinMember(*cit, offset)) {
Expand Down
7 changes: 2 additions & 5 deletions base_types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,10 +42,7 @@ class BaseType {
kFunctionPrototype
};

BaseType()
: id_(NextTypeId()),
pointer_(nullptr),
category_(kAtomic) {}
BaseType() : id_(NextTypeId()), pointer_(nullptr), category_(kAtomic) {}

using BaseTypes = std::vector<const BaseType*>;
using MemberTypes = std::vector<MemberType*>;
Expand Down
2 changes: 1 addition & 1 deletion basic_block.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions basic_block.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,8 @@

#include <forward_list>
#include <iosfwd>
#include <memory>
#include <map>
#include <memory>
#include <vector>
#undef max

Expand Down
2 changes: 1 addition & 1 deletion binexport.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion binexport.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion binexport2.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion binexport2_writer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion binexport2_writer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion binexport_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions call_graph.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -73,8 +73,7 @@ void CallGraph::Render(std::ostream* stream,
int library_index = function->GetLibraryIndex();
if (library_index != -1) {
const auto& library = library_manager_.GetKnownLibrary(library_index);
*stream << " from "
<< (library.IsStatic() ? "static" : "dynamic")
*stream << " from " << (library.IsStatic() ? "static" : "dynamic")
<< " library " << library.name;
}
// Prefer "\n" over endl when calling it in a loop as std::endl flushes the
Expand Down
2 changes: 1 addition & 1 deletion call_graph.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmake/BinExportDeps.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmake/BinExportOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmake/CompileOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindIdaSdk.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmake/Util.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion comment.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion comment.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion dump_writer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion dump_writer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion edge.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion edge.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion entry_point.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion entry_point.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion expression.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion expression.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions flow_analysis.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,8 +52,7 @@ void UpdateInstructionInDegree(Instructions* instructions,
} // namespace

void ReconstructFlowGraph(Instructions* instructions,
const FlowGraph& flow_graph,
CallGraph* call_graph) {
const FlowGraph& flow_graph, CallGraph* call_graph) {
UpdateInstructionInDegree(instructions, flow_graph);

// Add all instructions with an in-degree count of 0 as function entry points.
Expand Down
2 changes: 1 addition & 1 deletion flow_analysis.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
7 changes: 3 additions & 4 deletions flow_graph.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -391,9 +391,8 @@ void FlowGraph::MergeBasicBlocks(const CallGraph& call_graph) {
BasicBlock* source_basic_block = BasicBlock::FindContaining(edge.source);
if (!source_basic_block) {
LOG(INFO) << absl::StrCat("No source basic block for edge ",
absl::Hex(edge.source, absl::kZeroPad8),
" -> ",
absl::Hex(edge.target, absl::kZeroPad8));
absl::Hex(edge.source, absl::kZeroPad8), " -> ",
absl::Hex(edge.target, absl::kZeroPad8));
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion flow_graph.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion function.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion function.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2022 Google LLC
# Copyright 2011-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/arm.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/arm.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/begin_idasdk.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/dalvik.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ida/dalvik.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011-2022 Google LLC
// Copyright 2011-2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit fc8cb88

Please sign in to comment.