Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Llvm.NET/BitcodeModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,18 @@ public Function CreateFunction( string name
/// <param name="name">Name of the intrinsic</param>
/// <param name="args">Args for the intrinsic</param>
/// <returns>Function declaration</returns>
/// <remarks>
/// This method will match overloaded intrinsics based on the parameter types. If an intrinsic
/// has no overloads then an exact match is required. If the intrinsic has overloads than a prefix
/// match is used.
/// <note type="important">
/// It is important to note that the prefix match requires the name provided to have a length greater
/// than that of the name of the intrinsic and that the name starts with a matching overloaded intrinsic.
/// for example: 'llvm.memset' would not match the overloaded memset intrinsic but 'llvm.memset.p.i' does.
/// Thus, it is generally a good idea to use the signature from the LLVM documentation without the address
/// space, or bit widths. That is instead of 'llvm.memset.p0i8.i32' use 'llvm.memset.p.i'.
/// </note>
/// </remarks>
public Function GetIntrinsicDeclaration( string name, params ITypeRef[ ] args )
{
uint id = Intrinsic.LookupId( name );
Expand Down
2 changes: 1 addition & 1 deletion src/Llvm.NET/Instructions/InstructionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ public CallInstruction DebugTrap( )
public CallInstruction Trap( )
{
var module = GetModuleOrThrow( );
var func = module.GetIntrinsicDeclaration( "llvm.debugtrap" );
var func = module.GetIntrinsicDeclaration( "llvm.trap" );

return Call( func );
}
Expand Down