Skip to content

Commit 49e6c54

Browse files
DavidSpicketttomtor
authored andcommitted
[llvm][MemProf] Correct position of LLVM_ABI macro in computeFrameHistogram
The previous placement resulted in this warning when using g++-13: /home/david.spickett/llvm-project/llvm/include/llvm/Support/Compiler.h:120:43: warning: attribute ignored [-Wattributes] 120 | #define LLVM_ATTRIBUTE_VISIBILITY_DEFAULT [[gnu::visibility("default")]] | ^ /home/david.spickett/llvm-project/llvm/include/llvm/Support/Compiler.h:213:18: note: in expansion of macro ‘LLVM_ATTRIBUTE_VISIBILITY_DEFAULT’ 213 | #define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/david.spickett/llvm-project/llvm/lib/ProfileData/MemProfRadixTree.cpp:245:5: note: in expansion of macro ‘LLVM_ABI’ 245 | LLVM_ABI computeFrameHistogram<FrameId>( | ^~~~~~~~ /home/david.spickett/llvm-project/llvm/include/llvm/Support/Compiler.h:120:43: note: an attribute that appertains to a type-specifier is ignored 120 | #define LLVM_ATTRIBUTE_VISIBILITY_DEFAULT [[gnu::visibility("default")]] | ^ According to the interface guide, that macro should go before the return type to be effective. https://llvm.org/docs/InterfaceExportAnnotations.html#specialized-template-functions
1 parent 625cb1c commit 49e6c54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/ProfileData/MemProfRadixTree.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,13 @@ computeFrameHistogram(llvm::MapVector<CallStackId, llvm::SmallVector<FrameIdTy>>
241241
}
242242

243243
// Explicitly instantiate function with the utilized FrameIdTy.
244-
template llvm::DenseMap<FrameId, FrameStat>
245-
LLVM_ABI computeFrameHistogram<FrameId>(
246-
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>>
247-
&MemProfCallStackData);
248-
template llvm::DenseMap<LinearFrameId, FrameStat>
249-
LLVM_ABI computeFrameHistogram<LinearFrameId>(
250-
llvm::MapVector<CallStackId, llvm::SmallVector<LinearFrameId>>
251-
&MemProfCallStackData);
244+
template LLVM_ABI llvm::DenseMap<FrameId, FrameStat>
245+
computeFrameHistogram<FrameId>(
246+
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>>
247+
&MemProfCallStackData);
248+
template LLVM_ABI llvm::DenseMap<LinearFrameId, FrameStat>
249+
computeFrameHistogram<LinearFrameId>(
250+
llvm::MapVector<CallStackId, llvm::SmallVector<LinearFrameId>>
251+
&MemProfCallStackData);
252252
} // namespace memprof
253253
} // namespace llvm

0 commit comments

Comments
 (0)