Files
swift-mirror/test/Interop/C/swiftify-import/Inputs/comments.h
Henrik G. Olsson 341ee5124a [Swiftify] Copy doc comment from clang node (#81584)
Swift nodes imported from clang don't have doc comments carried over,
but IDEs are clever enough to fetch the comments from the associated
clang node. The swift node in the macro expansion from _SwiftifyImport
doesn't have a clang node directly associated with it however.

This patch adds the same comment from the clang node to the
_SwiftifyImport macro invocation node. Since the macro has access to
this node, it can easily copy over its leading trivia.

For now the comment is not altered at all, meaning @param still remains
even if the parmeter is removed.

rdar://151346977
(cherry picked from commit 6534b9b14f)
2025-05-29 00:20:07 -07:00

31 lines
663 B
C

#pragma once
#define __counted_by(x) __attribute__((__counted_by__(x)))
void begin();
// line comment
void lineComment(int len, int * __counted_by(len) p);
/// line doc comment
///
/// Here's a more complete description.
///
/// @param len the buffer length
/// @param p the buffer
void lineDocComment(int len, int * __counted_by(len) p);
/*
block comment
*/
void blockComment(int len, int * __counted_by(len) p);
/**
* block doc comment
*
* NB: it's very important to pass the correct length to this function
* @param len don't mess this one up
* @param p some integers to play with
*/
void blockDocComment(int len, int * __counted_by(len) p);