From d4f57fe52d991417fe98d2a1a448b31891467f93 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Fri, 21 Sep 2007 22:59:12 +0000 Subject: [PATCH] Adding support for __builtin_annotation with an intrinsic called llvm.annotation. This is similar to llvm.var.annotation but is applied to expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42211 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 37 +++++++++++++++++++++++++++++++++++++ include/llvm/Intrinsics.td | 4 ++++ 2 files changed, 41 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index 1b3f4f4afe9..05f4e66f882 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -210,6 +210,10 @@
  • llvm.var.annotation' Intrinsic
  • +
      +
    1. + llvm.annotation' Intrinsic
    2. +
    @@ -5263,6 +5267,39 @@ This can be useful for special purpose optimizations that want to look for these generation and optimization. + +
    + 'llvm.annotation' Intrinsic +
    + +
    + +
    Syntax:
    +
    +  declare i32 @llvm.annotation(i32 <val>, i8* <str>, i8* <str>, i32  <int> )
    +
    + +
    Overview:
    +

    This is an overloaded intrinsic. You can use 'llvm.annotation' on +any integer bit width. Not all targets support all bit widths however. +

    + +
    Arguments:
    + +

    +The first argument is an integer value (result of some expression), +the second is a pointer to a global string, the third is a pointer to a global +string which is the source file name, and the last argument is the line number. +

    + +
    Semantics:
    + +

    +This intrinsic allows annotations to be put on arbitrary expressions +with arbitrary strings. This can be useful for special purpose optimizations +that want to look for these annotations. These have no other defined use, they +are ignored by code generation and optimization. +


    diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index f7b46b2e6c1..9d3b1804faf 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -240,6 +240,10 @@ def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty, llvm_i32_ty]>; def int_var_annotation : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_i32_ty], [], "llvm.var.annotation">; + +def int_annotation : Intrinsic<[llvm_anyint_ty, LLVMMatchType<0>, llvm_ptr_ty, + llvm_ptr_ty, llvm_i32_ty], + [], "llvm.annotation">; //===------------------------ Trampoline Intrinsics -----------------------===// // -- 2.11.4.GIT