Skip to content

Commit

Permalink
Wrap headers in some ugly pragmas for disabling error checks. Helps i…
Browse files Browse the repository at this point in the history
…ntegration with downstream projects
  • Loading branch information
pgoodman committed Nov 8, 2020
1 parent 6388788 commit 26607a4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
12 changes: 10 additions & 2 deletions include/remill/Arch/Arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@
#pragma once

// clang-format off
#include "remill/BC/Compat/CTypes.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wswitch-enum"
#include <remill/BC/Compat/CTypes.h>
#include <remill/BC/Compat/CallingConvention.h>

#include <llvm/ADT/SmallVector.h>
#include <llvm/ADT/Triple.h>
#include <llvm/IR/DataLayout.h>
#include <llvm/IR/IRBuilder.h>
#include <remill/BC/Compat/CallingConvention.h>
#pragma clang diagnostic pop
// clang-format on

#include <functional>
Expand Down
7 changes: 7 additions & 0 deletions include/remill/BC/Annotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wswitch-enum"
#include <glog/logging.h>
#include <llvm/IR/Metadata.h>
#include <llvm/IR/Module.h>
#pragma clang diagnostic pop

#include <string>
#include <unordered_map>
Expand Down
7 changes: 7 additions & 0 deletions include/remill/BC/Optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wswitch-enum"
#include <llvm/IR/Module.h>
#pragma clang diagnostic pop

#include <functional>
#include <initializer_list>
Expand Down
12 changes: 9 additions & 3 deletions include/remill/BC/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
#pragma once

// clang-format off
#include "remill/BC/Compat/CTypes.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wswitch-enum"
#include <remill/BC/Compat/CTypes.h>
#include <llvm/ADT/SmallVector.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>

#pragma clang diagnostic pop
// clang-format on

#include <array>
Expand All @@ -31,7 +37,7 @@
#include <unordered_map>
#include <vector>

#include "remill/BC/ABI.h"
#include <remill/BC/ABI.h>

namespace llvm {
class Argument;
Expand Down
7 changes: 7 additions & 0 deletions include/remill/BC/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wswitch-enum"
#include <llvm/Config/llvm-config.h>
#pragma clang diagnostic pop

#define LLVM_VERSION(major, minor) ((major * 100) + minor)

Expand Down

0 comments on commit 26607a4

Please sign in to comment.