impc:ir:types-equal?   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmir.xtm

Implementation

(define impc:ir:types-equal?
  (lambda (a b)
    (if (string? a)
        (if (impc:ti:get-named-type (impc:ir:get-base-type (impc:ir:clean-named-type a)))
            (let* ((nt (impc:ti:get-named-type (impc:ir:get-base-type (impc:ir:clean-named-type a))))
                   (ptrdepth (impc:ir:get-ptr-depth a))
                   (strtype (impc:ir:pointer++ nt ptrdepth)))
              (set! a (impc:ir:get-type-from-str strtype)))
            (set! a (impc:ir:get-type-from-str a))))
    (if (string? b)
        (if (impc:ti:get-named-type (impc:ir:get-base-type (impc:ir:clean-named-type b)))
            (let* ((nt (impc:ti:get-named-type (impc:ir:get-base-type (impc:ir:clean-named-type b))))
                   (ptrdepth (impc:ir:get-ptr-depth b))
                   (strtype (impc:ir:pointer++ nt ptrdepth)))
              (set! b (impc:ir:get-type-from-str strtype)))
            (set! b (impc:ir:get-type-from-str b))))
    ;; (println 'equal? a b)
    (equal? a b)))


Back to Index