Skip to content

Commit 36128f4

Browse files
committed
[llvm] manual fix-ups to IDS codemod of remaining llvm interfaces
1 parent 4242b97 commit 36128f4

File tree

20 files changed

+62
-43
lines changed

20 files changed

+62
-43
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "llvm/ProfileData/InstrProfCorrelator.h"
4444
#include "llvm/Support/BuryPointer.h"
4545
#include "llvm/Support/CommandLine.h"
46+
#include "llvm/Support/Compiler.h"
4647
#include "llvm/Support/MemoryBuffer.h"
4748
#include "llvm/Support/PrettyStackTrace.h"
4849
#include "llvm/Support/Program.h"
@@ -96,8 +97,6 @@ using namespace llvm;
9697
#include "llvm/Support/Extension.def"
9798

9899
namespace llvm {
99-
extern cl::opt<bool> PrintPipelinePasses;
100-
101100
// Experiment to move sanitizers earlier.
102101
static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP(
103102
"sanitizer-early-opt-ep", cl::Optional,
@@ -118,7 +117,7 @@ static cl::opt<PGOOptions::ColdFuncOpt> ClPGOColdFuncAttr(
118117
clEnumValN(PGOOptions::ColdFuncOpt::OptNone, "optnone",
119118
"Mark cold functions with optnone.")));
120119

121-
extern cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
120+
LLVM_ABI extern cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
122121
} // namespace llvm
123122
namespace clang {
124123
extern llvm::cl::opt<bool> ClSanitizeGuardChecks;

flang/lib/Frontend/FrontendActions.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@
7474
#include <memory>
7575
#include <system_error>
7676

77-
namespace llvm {
78-
extern cl::opt<bool> PrintPipelinePasses;
79-
} // namespace llvm
80-
8177
using namespace Fortran::frontend;
8278

8379
constexpr llvm::StringLiteral timingIdParse = "Parse";

llvm/include/llvm/ADT/APFloat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ class IEEEFloat final {
673673

674674
integerPart addSignificand(const IEEEFloat &);
675675
integerPart subtractSignificand(const IEEEFloat &, integerPart);
676-
lostFraction addOrSubtractSignificand(const IEEEFloat &, bool subtract);
676+
// Exported for IEEEFloatUnitTestHelper.
677+
LLVM_ABI lostFraction addOrSubtractSignificand(const IEEEFloat &, bool subtract);
677678
lostFraction multiplySignificand(const IEEEFloat &, IEEEFloat,
678679
bool ignoreAddend = false);
679680
lostFraction multiplySignificand(const IEEEFloat&);

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ class [[nodiscard]] APInt {
561561
}
562562

563563
/// Overload to compute a hash_code for an APInt value.
564-
friend hash_code hash_value(const APInt &Arg);
564+
LLVM_ABI_FRIEND friend hash_code hash_value(const APInt &Arg);
565565

566566
/// This function returns a pointer to the internal storage of the APInt.
567567
/// This is useful for writing out the APInt in binary form without any

llvm/include/llvm/ADT/DynamicAPInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class DynamicAPInt {
212212
friend DynamicAPInt operator/(int64_t A, const DynamicAPInt &B);
213213
friend DynamicAPInt operator%(int64_t A, const DynamicAPInt &B);
214214

215-
friend hash_code hash_value(const DynamicAPInt &x); // NOLINT
215+
LLVM_ABI_FRIEND friend hash_code hash_value(const DynamicAPInt &x); // NOLINT
216216

217217
LLVM_ABI void static_assert_layout(); // NOLINT
218218

llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,15 @@ class LLVM_ABI CallLowering {
609609
virtual bool isTypeIsValidForThisReturn(EVT Ty) const { return false; }
610610
};
611611

612+
extern template LLVM_ABI void
613+
CallLowering::setArgFlags<Function>(CallLowering::ArgInfo &Arg, unsigned OpIdx,
614+
const DataLayout &DL,
615+
const Function &FuncInfo) const;
616+
617+
extern template LLVM_ABI void
618+
CallLowering::setArgFlags<CallBase>(CallLowering::ArgInfo &Arg, unsigned OpIdx,
619+
const DataLayout &DL,
620+
const CallBase &FuncInfo) const;
612621
} // end namespace llvm
613622

614623
#endif // LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H

llvm/include/llvm/Support/Timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class TimerGroup {
258258

259259
private:
260260
friend class Timer;
261-
friend void PrintStatisticsJSON(raw_ostream &OS);
261+
LLVM_ABI_FRIEND friend void PrintStatisticsJSON(raw_ostream &OS);
262262
void addTimer(Timer &T);
263263
void removeTimer(Timer &T);
264264
void prepareToPrintList(bool reset_time = false);

llvm/include/llvm/Telemetry/Telemetry.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,13 @@ class Destination {
144144
/// monitored and transmitting the data elsewhere.
145145
class LLVM_ABI Manager {
146146
public:
147+
Manager() = default;
147148
virtual ~Manager() = default;
148149

150+
// Explicitly non-copyable.
151+
Manager(Manager const&) = delete;
152+
Manager& operator=(Manager const&) = delete;
153+
149154
// Dispatch Telemetry data to the Destination(s).
150155
// The argument is non-const because the Manager may add or remove
151156
// data from the entry.

llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#ifndef LLVM_TOOLDRIVERS_LLVM_DLLTOOL_DLLTOOLDRIVER_H
1515
#define LLVM_TOOLDRIVERS_LLVM_DLLTOOL_DLLTOOLDRIVER_H
1616

17+
#include "llvm/Support/Compiler.h"
18+
1719
namespace llvm {
1820
template <typename T> class ArrayRef;
1921

llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#ifndef LLVM_TOOLDRIVERS_LLVM_LIB_LIBDRIVER_H
1515
#define LLVM_TOOLDRIVERS_LLVM_LIB_LIBDRIVER_H
1616

17+
#include "llvm/Support/Compiler.h"
18+
1719
namespace llvm {
1820
template <typename T> class ArrayRef;
1921

0 commit comments

Comments
 (0)