Files
UnrealEngineUWP/Engine/Source/Programs/UnrealCodeAnalyzer/Private/ThreadSafety/TSVisitor.h
Mikolaj Sieluzycki ddf0f7e588 Add basic UObject thread safety checks to UnrealCodeAnalyzer.
[CL 2631991 by Mikolaj Sieluzycki in Main branch]
2015-07-24 04:48:48 -04:00

26 lines
787 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "clang/AST/RecursiveASTVisitor.h"
namespace UnrealCodeAnalyzer
{
class FTSVisitor : public clang::RecursiveASTVisitor<FTSVisitor>
{
public:
explicit FTSVisitor(clang::ASTContext* InContext, clang::StringRef InFile);
bool VisitCXXConstructorDecl(clang::CXXConstructorDecl* Decl);
bool TraverseCXXMethodDecl(clang::CXXMethodDecl* Decl);
bool VisitDeclRefExpr(clang::DeclRefExpr* Expr);
bool VisitCallExpr(clang::CallExpr* Expr);
private:
bool InheritsFromUObject(clang::CXXConstructorDecl* Decl);
bool IsGlobalVariable(clang::VarDecl* VarDecl);
clang::SourceManager& SourceManager;
TArray<clang::CXXMethodDecl*> FunctionDeclarationsStack;
TSet<clang::Decl*> VisitedDecls;
};
}