Skip to content

Commit f0ee670

Browse files
authored
Do not emit UnusedParameter warnings for LLVM code (#76)
1 parent 735c389 commit f0ee670

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

include/nyxstone.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
#include <expected.hpp>
44

5+
#pragma GCC diagnostic push
6+
#pragma GCC diagnostic ignored "-Wunused-parameter"
57
#include <llvm/MC/MCAsmInfo.h>
68
#include <llvm/MC/MCInstPrinter.h>
79
#include <llvm/MC/MCInstrInfo.h>
810
#include <llvm/MC/MCRegisterInfo.h>
911
#include <llvm/MC/MCSubtargetInfo.h>
1012
#include <llvm/MC/TargetRegistry.h>
13+
#pragma GCC diagnostic pop
1114

1215
namespace nyxstone {
1316

src/ELFStreamerWrapper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <llvm/MC/MCELFStreamer.h>
66

7+
#pragma GCC diagnostic push
8+
#pragma GCC diagnostic ignored "-Wunused-parameter"
79
#include <llvm/MC/MCAsmBackend.h>
810
#include <llvm/MC/MCAsmLayout.h>
911
#include <llvm/MC/MCAssembler.h>
@@ -18,6 +20,7 @@
1820
#include <llvm/MC/MCSymbol.h>
1921
#include <llvm/MC/MCValue.h>
2022
#include <llvm/Support/Casting.h>
23+
#pragma GCC diagnostic pop
2124

2225
#include <numeric>
2326
#include <sstream>

src/ELFStreamerWrapper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
#include "nyxstone.h"
44

5+
#pragma GCC diagnostic push
6+
#pragma GCC diagnostic ignored "-Wunused-parameter"
57
#include <llvm/MC/MCAsmBackend.h>
68
#include <llvm/MC/MCCodeEmitter.h>
79
#include <llvm/MC/MCELFStreamer.h>
810
#include <llvm/MC/MCObjectWriter.h>
11+
#pragma GCC diagnostic pop
912

1013
namespace nyxstone {
1114
/// This class derives from LLVM's MCELFStreamer, which enables us to receive

src/ObjectWriterWrapper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

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

7+
#pragma GCC diagnostic push
8+
#pragma GCC diagnostic ignored "-Wunused-parameter"
79
#include <llvm/MC/MCAsmBackend.h>
810
#include <llvm/MC/MCAsmLayout.h>
911
#include <llvm/MC/MCAssembler.h>
@@ -16,6 +18,7 @@
1618
#include <llvm/MC/MCSection.h>
1719
#include <llvm/MC/MCSymbol.h>
1820
#include <llvm/MC/MCValue.h>
21+
#pragma GCC diagnostic pop
1922

2023
namespace nyxstone {
2124
/// This class enables us to limit the final output byte stream to the

src/nyxstone.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "ELFStreamerWrapper.h"
44
#include "ObjectWriterWrapper.h"
55

6+
#pragma GCC diagnostic push
7+
#pragma GCC diagnostic ignored "-Wunused-parameter"
68
#include <llvm/MC/MCAsmBackend.h>
79
#include <llvm/MC/MCCodeEmitter.h>
810
#include <llvm/MC/MCDisassembler/MCDisassembler.h>
@@ -14,6 +16,7 @@
1416
#include <llvm/MC/TargetRegistry.h>
1517
#include <llvm/Support/SourceMgr.h>
1618
#include <llvm/Support/TargetSelect.h>
19+
#pragma GCC diagnostic pop
1720

1821
#include <mutex>
1922
#include <numeric>

0 commit comments

Comments
 (0)