Lines Matching full:clang
21 #include "clang/AST/ASTContext.h"
22 #include "clang/AST/Attr.h"
23 #include "clang/AST/Decl.h"
24 #include "clang/AST/DeclBase.h"
25 #include "clang/AST/Mangle.h"
26 #include "clang/AST/Type.h"
28 #include "clang/Basic/Linkage.h"
29 #include "clang/Basic/TargetInfo.h"
49 RSContext::RSContext(clang::Preprocessor &PP,
50 clang::ASTContext &Ctx,
51 const clang::TargetInfo &Target,
80 bool RSContext::processExportVar(const clang::VarDecl *VD) {
96 int RSContext::getForEachSlotNumber(const clang::FunctionDecl* FD) {
97 const clang::StringRef& funcName = FD->getName();
101 int RSContext::getForEachSlotNumber(const clang::StringRef& funcName) {
109 bool RSContext::processExportFunc(const clang::FunctionDecl *FD) {
116 slangAssert(FD->getStorageClass() == clang::SC_None);
138 if (FD->hasAttr<clang::RenderScriptKernelAttr>()) {
161 bool RSContext::addForEach(const clang::FunctionDecl* FD) {
175 clang::TranslationUnitDecl *TUDecl = mCtx.getTranslationUnitDecl();
180 const clang::IdentifierInfo *II = mPP.getIdentifierInfo(Name);
186 clang::DeclContext::lookup_result R = TUDecl->lookup(II);
189 for (clang::DeclContext::lookup_iterator I = R.begin(), E = R.end();
192 clang::NamedDecl *const ND = *I;
193 const clang::Type *T = nullptr;
196 case clang::Decl::Typedef: {
197 T = static_cast<const clang::TypedefDecl*>(
201 case clang::Decl::Record: {
202 T = static_cast<const clang::RecordDecl*>(ND)->getTypeForDecl();
218 void RSContext::setAllocationType(const clang::TypeDecl* TD) {
222 void RSContext::setScriptCallType(const clang::TypeDecl* TD) {
233 clang::TranslationUnitDecl *TUDecl = mCtx.getTranslationUnitDecl();
235 clang::Decl* D = *I;
237 case clang::Decl::Var: {
238 clang::VarDecl* VD = llvm::dyn_cast<clang::VarDecl>(D);
240 if (VD->getFormalLinkage() == clang::ExternalLinkage) {
241 clang::QualType QT = VD->getTypeSourceInfo()->getType();
249 clang::DiagnosticsEngine *DiagEngine = getDiagnostics();
251 clang::DiagnosticsEngine::Error,
265 case clang::Decl::Function: {
266 clang::FunctionDecl* FD = llvm::dyn_cast<clang::FunctionDecl>(D);
267 if (FD->getFormalLinkage() == clang::ExternalLinkage) {
311 BE->HandleTopLevelDecl(clang::DeclGroupRef(DummyVar));
321 void RSContext::markUsedByReducePragma(clang::FunctionDecl *FD, CheckName Check) {
344 // This is needed to prevent clang from warning that the function is
351 // This is a trick to ensure that clang will not delete "f" as unused.
358 const clang::QualType VoidPtrType = mCtx.getPointerType(mCtx.VoidTy);
360 clang::DeclContext *const DC = FD->getDeclContext();
361 const clang::SourceLocation Loc = FD->getLocation();
363 clang::VarDecl *const VD = clang::VarDecl::Create(
368 clang::SC_None);
372 clang::DeclRefExpr *const DRE = clang::DeclRefExpr::Create(mCtx,
373 clang::NestedNameSpecifierLoc(),
376 clang::VK_RValue);
377 clang::ImplicitCastExpr *const ICE = clang::ImplicitCastExpr::Create(mCtx, mCtx.getPointerType(FD->getType()),
378 clang::CK_FunctionToPointerDecay, DRE,
379 nullptr, clang::VK_RValue);
380 clang::CStyleCastExpr *const CSCE = clang::CStyleCastExpr::Create(mCtx, VoidPtrType, clang::VK_RValue, clang::CK_BitCast,