1 //===--- ProfileList.h - ProfileList filter ---------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // User-provided filters include/exclude profile instrumentation in certain 10 // functions. 11 // 12 //===----------------------------------------------------------------------===// 13 #ifndef LLVM_CLANG_BASIC_INSTRPROFLIST_H 14 #define LLVM_CLANG_BASIC_INSTRPROFLIST_H 15 16 #include "clang/Basic/CodeGenOptions.h" 17 #include "clang/Basic/LLVM.h" 18 #include "clang/Basic/SourceLocation.h" 19 #include "llvm/ADT/ArrayRef.h" 20 #include "llvm/ADT/Optional.h" 21 #include "llvm/ADT/StringRef.h" 22 #include <memory> 23 24 namespace llvm { 25 class SpecialCaseList; 26 } 27 28 namespace clang { 29 30 class ProfileSpecialCaseList; 31 32 class ProfileList { 33 std::unique_ptr<ProfileSpecialCaseList> SCL; 34 const bool Empty; 35 const bool Default; 36 SourceManager &SM; 37 38 public: 39 ProfileList(ArrayRef<std::string> Paths, SourceManager &SM); 40 ~ProfileList(); 41 isEmpty()42 bool isEmpty() const { return Empty; } getDefault()43 bool getDefault() const { return Default; } 44 45 llvm::Optional<bool> 46 isFunctionExcluded(StringRef FunctionName, 47 CodeGenOptions::ProfileInstrKind Kind) const; 48 llvm::Optional<bool> 49 isLocationExcluded(SourceLocation Loc, 50 CodeGenOptions::ProfileInstrKind Kind) const; 51 llvm::Optional<bool> 52 isFileExcluded(StringRef FileName, 53 CodeGenOptions::ProfileInstrKind Kind) const; 54 }; 55 56 } // namespace clang 57 58 #endif 59