Skip to content

Commit 99bb383

Browse files
committed
SILOptimizer: use LLVM_ATTRIBUTE_USED
This makes the use of the used attribute more portable. `__attribute__((__used__))` is not accepted by Visual Studio, but LLVM conveniently provides the helpful macro `LLVM_ATTRIBUTE_USED` to enable this.
1 parent d15d752 commit 99bb383

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ struct AvailableValue {
247247
return {NewValue, SubElementNumber, InsertionPoints};
248248
}
249249

250-
void dump() const __attribute__((used));
250+
void dump() const LLVM_ATTRIBUTE_USED;
251251
void print(llvm::raw_ostream &os) const;
252252

253253
private:
@@ -379,7 +379,7 @@ class AvailableValueAggregator {
379379
SILValue aggregateValues(SILType LoadTy, SILValue Address, unsigned FirstElt);
380380

381381
void print(llvm::raw_ostream &os) const;
382-
void dump() const __attribute__((used));
382+
void dump() const LLVM_ATTRIBUTE_USED;
383383

384384
private:
385385
SILValue aggregateFullyAvailableValue(SILType LoadTy, unsigned FirstElt);

0 commit comments

Comments
 (0)