Skip to content

Commit

Permalink
Do not emit UnusedParameter warnings for LLVM code
Browse files Browse the repository at this point in the history
  • Loading branch information
stuxnot committed Nov 1, 2024
1 parent 6a937a0 commit 0b020f8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/nyxstone.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

#include <expected.hpp>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <llvm/MC/MCAsmInfo.h>
#include <llvm/MC/MCInstPrinter.h>
#include <llvm/MC/MCInstrInfo.h>
#include <llvm/MC/MCRegisterInfo.h>
#include <llvm/MC/MCSubtargetInfo.h>
#include <llvm/MC/TargetRegistry.h>
#pragma GCC diagnostic pop

namespace nyxstone {

Expand Down
3 changes: 3 additions & 0 deletions src/ELFStreamerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <llvm/MC/MCELFStreamer.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <llvm/MC/MCAsmBackend.h>
#include <llvm/MC/MCAsmLayout.h>
#include <llvm/MC/MCAssembler.h>
Expand All @@ -18,6 +20,7 @@
#include <llvm/MC/MCSymbol.h>
#include <llvm/MC/MCValue.h>
#include <llvm/Support/Casting.h>
#pragma GCC diagnostic pop

#include <numeric>
#include <sstream>
Expand Down
3 changes: 3 additions & 0 deletions src/ELFStreamerWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

#include "nyxstone.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <llvm/MC/MCAsmBackend.h>
#include <llvm/MC/MCCodeEmitter.h>
#include <llvm/MC/MCELFStreamer.h>
#include <llvm/MC/MCObjectWriter.h>
#pragma GCC diagnostic pop

namespace nyxstone {
/// This class derives from LLVM's MCELFStreamer, which enables us to receive
Expand Down
3 changes: 3 additions & 0 deletions src/ObjectWriterWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <llvm/Config/llvm-config.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <llvm/MC/MCAsmBackend.h>
#include <llvm/MC/MCAsmLayout.h>
#include <llvm/MC/MCAssembler.h>
Expand All @@ -16,6 +18,7 @@
#include <llvm/MC/MCSection.h>
#include <llvm/MC/MCSymbol.h>
#include <llvm/MC/MCValue.h>
#pragma GCC diagnostic pop

namespace nyxstone {
/// This class enables us to limit the final output byte stream to the
Expand Down
3 changes: 3 additions & 0 deletions src/nyxstone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "ELFStreamerWrapper.h"
#include "ObjectWriterWrapper.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <llvm/MC/MCAsmBackend.h>
#include <llvm/MC/MCCodeEmitter.h>
#include <llvm/MC/MCDisassembler/MCDisassembler.h>
Expand All @@ -14,6 +16,7 @@
#include <llvm/MC/TargetRegistry.h>
#include <llvm/Support/SourceMgr.h>
#include <llvm/Support/TargetSelect.h>
#pragma GCC diagnostic pop

#include <mutex>
#include <numeric>
Expand Down

0 comments on commit 0b020f8

Please sign in to comment.