14 #ifndef LLVM_CLANG_BASIC_OPTREPORTHANDLER_H
15 #define LLVM_CLANG_BASIC_OPTREPORTHANDLER_H
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/StringRef.h"
27 struct OptReportInfo {
28 std::string KernelArgDescName;
31 std::string KernelArgType;
33 unsigned KernelArgSize;
34 std::string KernelArgDesc;
35 std::string KernelArgDecomposedField;
37 OptReportInfo(std::string ArgDescName, std::string ArgType,
39 std::string ArgDecomposedField)
40 : KernelArgDescName(std::move(ArgDescName)),
41 KernelArgType(std::move(ArgType)), KernelArgLoc(ArgLoc),
42 KernelArgSize(ArgSize), KernelArgDesc(std::move(ArgDesc)),
43 KernelArgDecomposedField(std::move(ArgDecomposedField)) {}
45 llvm::DenseMap<const FunctionDecl *, SmallVector<OptReportInfo>> Map;
50 StringRef ArgDesc, StringRef ArgDecomposedField) {
51 Map[FD].emplace_back(ArgDescName.data(), ArgType.data(), ArgLoc, ArgSize,
52 ArgDesc.data(), ArgDecomposedField.data());
55 auto It = Map.find(FD);
56 assert(It != Map.end());
60 return Map.find(FD) != Map.end();
Defines the clang::SourceLocation class and associated facilities.
Represents a function declaration or definition.
Encodes a location in the source.
SmallVector< OptReportInfo > & GetInfo(const FunctionDecl *FD)
void AddKernelArgs(const FunctionDecl *FD, StringRef ArgDescName, StringRef ArgType, SourceLocation ArgLoc, unsigned ArgSize, StringRef ArgDesc, StringRef ArgDecomposedField)
bool HasOptReportInfo(const FunctionDecl *FD) const
The JSON file list parser is used to communicate input to InstallAPI.