about summary refs log tree commit diff stats
path: root/wrapperhelper/utils.h
blob: 258653766e525e8a1f12889e86d63d2d058db39c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include <clang/AST/Decl.h>
#include <clang/AST/Type.h>
#include <clang/Tooling/Tooling.h>
#include <clang/AST/RecordLayout.h>
#include <clang/AST/Decl.h>

#include <llvm/ADT/Triple.h>
#include <llvm/Support/Casting.h>

#include <cstddef>
#include <cstring>
#include <iostream>

static const clang::Type* StripTypedef(clang::QualType type) {
    if (type->isTypedefNameType()) {
        return StripTypedef(type->getAs<clang::TypedefType>()->getDecl()->getUnderlyingType());
    } else {
        return type.getTypePtr();
    }
}