次の C 構造体定義があるとします。
struct stringStructure
{
char *stringVariable;
};
上記の場合、Clang は次の LLVM IR を生成します。
%struct.stringStructure = type { i8* }
...これには、変数 identifier を除くすべてが私の定義に含まれますstringVariable
。
アプリケーション (LLVM C++ API を使用) から名前で参照できるように、生成された LLVM IR に識別子をエクスポートする方法を見つけたいと思います。
annotate
次のように、属性を追加しようとしました。
char *stringVariable __attribute__((annotate("stringVariable")));
...しかし、注釈はうまくいかないようです (構造はまだ として定義されていますtype { i8* }
)。
何か案は?