Skip to content

Commit 33a1da7

Browse files
committed
[llvm] export private API so that CodeGenTests builds against Windows DLL
1 parent b8bda9d commit 33a1da7

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

llvm/lib/CodeGen/AsmPrinter/DIEHash.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/DenseMap.h"
1717
#include "llvm/CodeGen/DIE.h"
18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/Support/MD5.h"
1920

2021
namespace llvm {
@@ -38,7 +39,7 @@ class DIEHash {
3839
uint64_t computeCUSignature(StringRef DWOName, const DIE &Die);
3940

4041
/// Computes the type signature.
41-
uint64_t computeTypeSignature(const DIE &Die);
42+
LLVM_ABI uint64_t computeTypeSignature(const DIE &Die);
4243

4344
// Helper routines to process parts of a DIE.
4445
private:

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/CodeGen/MachineInstr.h"
2020
#include "llvm/CodeGen/TargetRegisterInfo.h"
2121
#include "llvm/IR/DebugInfoMetadata.h"
22+
#include "llvm/Support/Compiler.h"
2223
#include <optional>
2324

2425
#include "LiveDebugValues.h"
@@ -204,8 +205,8 @@ class ValueIDNum {
204205
.str();
205206
}
206207

207-
static ValueIDNum EmptyValue;
208-
static ValueIDNum TombstoneValue;
208+
LLVM_ABI static ValueIDNum EmptyValue;
209+
LLVM_ABI static ValueIDNum TombstoneValue;
209210
};
210211

211212
} // End namespace LiveDebugValues
@@ -425,7 +426,7 @@ struct DbgOpID {
425426
DbgOpID(uint32_t RawID) : RawID(RawID) {}
426427
DbgOpID(bool IsConst, uint32_t Index) : ID({IsConst, Index}) {}
427428

428-
static DbgOpID UndefID;
429+
LLVM_ABI static DbgOpID UndefID;
429430

430431
bool operator==(const DbgOpID &Other) const { return RawID == Other.RawID; }
431432
bool operator!=(const DbgOpID &Other) const { return !(*this == Other); }
@@ -788,7 +789,7 @@ class MLocTracker {
788789
value_type operator*() { return value_type(Idx, ValueMap[LocIdx(Idx)]); }
789790
};
790791

791-
MLocTracker(MachineFunction &MF, const TargetInstrInfo &TII,
792+
LLVM_ABI MLocTracker(MachineFunction &MF, const TargetInstrInfo &TII,
792793
const TargetRegisterInfo &TRI, const TargetLowering &TLI);
793794

794795
/// Produce location ID number for a Register. Provides some small amount of
@@ -903,7 +904,7 @@ class MLocTracker {
903904

904905
/// Create a LocIdx for an untracked register ID. Initialize it to either an
905906
/// mphi value representing a live-in, or a recent register mask clobber.
906-
LocIdx trackRegister(unsigned ID);
907+
LLVM_ABI LocIdx trackRegister(unsigned ID);
907908

908909
LocIdx lookupOrTrackRegister(unsigned ID) {
909910
LocIdx &Index = LocIDToLocIdx[ID];
@@ -968,7 +969,7 @@ class MLocTracker {
968969
/// Find LocIdx for SpillLoc \p L, creating a new one if it's not tracked.
969970
/// Returns std::nullopt when in scenarios where a spill slot could be
970971
/// tracked, but we would likely run into resource limitations.
971-
std::optional<SpillLocationNo> getOrTrackSpillLoc(SpillLoc L);
972+
LLVM_ABI std::optional<SpillLocationNo> getOrTrackSpillLoc(SpillLoc L);
972973

973974
// Get LocIdx of a spill ID.
974975
LocIdx getSpillMLoc(unsigned SpillID) {
@@ -1342,7 +1343,7 @@ class InstrRefBasedLDV : public LDVImpl {
13421343
/// in an MLocTracker. Convert the observations into a per-block transfer
13431344
/// function in \p MLocTransfer, suitable for using with the machine value
13441345
/// location dataflow problem.
1345-
void
1346+
LLVM_ABI void
13461347
produceMLocTransferFunction(MachineFunction &MF,
13471348
SmallVectorImpl<MLocTransferMap> &MLocTransfer,
13481349
unsigned MaxNumBlocks);
@@ -1352,7 +1353,7 @@ class InstrRefBasedLDV : public LDVImpl {
13521353
/// live-out arrays to the (initialized to zero) multidimensional arrays in
13531354
/// \p MInLocs and \p MOutLocs. The outer dimension is indexed by block
13541355
/// number, the inner by LocIdx.
1355-
void buildMLocValueMap(MachineFunction &MF, FuncValueTable &MInLocs,
1356+
LLVM_ABI void buildMLocValueMap(MachineFunction &MF, FuncValueTable &MInLocs,
13561357
FuncValueTable &MOutLocs,
13571358
SmallVectorImpl<MLocTransferMap> &MLocTransfer);
13581359

@@ -1362,7 +1363,7 @@ class InstrRefBasedLDV : public LDVImpl {
13621363

13631364
/// Install PHI values into the live-in array for each block, according to
13641365
/// the IDF of each register.
1365-
void placeMLocPHIs(MachineFunction &MF,
1366+
LLVM_ABI void placeMLocPHIs(MachineFunction &MF,
13661367
SmallPtrSetImpl<MachineBasicBlock *> &AllBlocks,
13671368
FuncValueTable &MInLocs,
13681369
SmallVectorImpl<MLocTransferMap> &MLocTransfer);
@@ -1422,7 +1423,7 @@ class InstrRefBasedLDV : public LDVImpl {
14221423
/// \p AssignBlocks contains the set of blocks that aren't in \p DILoc's
14231424
/// scope, but which do contain DBG_VALUEs, which VarLocBasedImpl tracks
14241425
/// locations through.
1425-
void buildVLocValueMap(const DILocation *DILoc,
1426+
LLVM_ABI void buildVLocValueMap(const DILocation *DILoc,
14261427
const SmallSet<DebugVariableID, 4> &VarsWeCareAbout,
14271428
SmallPtrSetImpl<MachineBasicBlock *> &AssignBlocks,
14281429
LiveInsT &Output, FuncValueTable &MOutLocs,
@@ -1436,7 +1437,7 @@ class InstrRefBasedLDV : public LDVImpl {
14361437
/// \p LiveIn Old live-in value, overwritten with new one if live-in changes.
14371438
/// \returns true if any live-ins change value, either from value propagation
14381439
/// or PHI elimination.
1439-
bool vlocJoin(MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
1440+
LLVM_ABI bool vlocJoin(MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
14401441
SmallPtrSet<const MachineBasicBlock *, 8> &BlocksToExplore,
14411442
DbgValue &LiveIn);
14421443

@@ -1445,7 +1446,7 @@ class InstrRefBasedLDV : public LDVImpl {
14451446
/// into that operand join together.
14461447
/// \returns true if a joined location was found for every value that needed
14471448
/// to be joined.
1448-
bool
1449+
LLVM_ABI bool
14491450
pickVPHILoc(SmallVectorImpl<DbgOpID> &OutValues, const MachineBasicBlock &MBB,
14501451
const LiveIdxT &LiveOuts, FuncValueTable &MOutLocs,
14511452
const SmallVectorImpl<const MachineBasicBlock *> &BlockOrders);
@@ -1461,7 +1462,7 @@ class InstrRefBasedLDV : public LDVImpl {
14611462

14621463
/// Boilerplate computation of some initial sets, artifical blocks and
14631464
/// RPOT block ordering.
1464-
void initialSetup(MachineFunction &MF);
1465+
LLVM_ABI void initialSetup(MachineFunction &MF);
14651466

14661467
/// Produce a map of the last lexical scope that uses a block, using the
14671468
/// scopes DFSOut number. Mapping is block-number to DFSOut.
@@ -1490,7 +1491,7 @@ class InstrRefBasedLDV : public LDVImpl {
14901491

14911492
public:
14921493
/// Default construct and initialize the pass.
1493-
InstrRefBasedLDV();
1494+
LLVM_ABI InstrRefBasedLDV();
14941495

14951496
LLVM_DUMP_METHOD
14961497
void dump_mloc_transfer(const MLocTransferMap &mloc_transfer) const;

llvm/lib/CodeGen/MLRegAllocEvictAdvisor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/Analysis/MLModelRunner.h"
1818
#include "llvm/CodeGen/MachineBasicBlock.h"
1919
#include "llvm/CodeGen/SlotIndexes.h"
20+
#include "llvm/Support/Compiler.h"
2021
#include <map>
2122

2223
namespace llvm {
@@ -32,7 +33,7 @@ struct LRStartEndInfo {
3233
size_t Pos = 0;
3334
};
3435

35-
void extractInstructionFeatures(
36+
LLVM_ABI void extractInstructionFeatures(
3637
llvm::SmallVectorImpl<LRStartEndInfo> &LRPosInfo,
3738
MLModelRunner *RegallocRunner, function_ref<int(SlotIndex)> GetOpcode,
3839
function_ref<float(SlotIndex)> GetMBBFreq,
@@ -41,7 +42,7 @@ void extractInstructionFeatures(
4142
const int MBBFreqIndex, const int MBBMappingIndex,
4243
const SlotIndex LastIndex);
4344

44-
void extractMBBFrequency(const SlotIndex CurrentIndex,
45+
LLVM_ABI void extractMBBFrequency(const SlotIndex CurrentIndex,
4546
const size_t CurrentInstructionIndex,
4647
std::map<MachineBasicBlock *, size_t> &VisitedMBBs,
4748
function_ref<float(SlotIndex)> GetMBBFreq,

llvm/lib/CodeGen/RegAllocScore.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define LLVM_CODEGEN_REGALLOCSCORE_H_
1717

1818
#include "llvm/ADT/STLFunctionalExtras.h"
19+
#include "llvm/Support/Compiler.h"
1920

2021
namespace llvm {
2122

@@ -52,9 +53,9 @@ class RegAllocScore final {
5253
void onCheapRemat(double Freq) { CheapRematCounts += Freq; }
5354

5455
RegAllocScore &operator+=(const RegAllocScore &Other);
55-
bool operator==(const RegAllocScore &Other) const;
56+
LLVM_ABI bool operator==(const RegAllocScore &Other) const;
5657
bool operator!=(const RegAllocScore &Other) const;
57-
double getScore() const;
58+
LLVM_ABI double getScore() const;
5859
};
5960

6061
/// Calculate a score. When comparing 2 scores for the same function but
@@ -64,7 +65,7 @@ RegAllocScore calculateRegAllocScore(const MachineFunction &MF,
6465
const MachineBlockFrequencyInfo &MBFI);
6566

6667
/// Implementation of the above, which is also more easily unittestable.
67-
RegAllocScore calculateRegAllocScore(
68+
LLVM_ABI RegAllocScore calculateRegAllocScore(
6869
const MachineFunction &MF,
6970
llvm::function_ref<double(const MachineBasicBlock &)> GetBBFreq,
7071
llvm::function_ref<bool(const MachineInstr &)> IsTriviallyRematerializable);

0 commit comments

Comments
 (0)