LLVM 23.0.0git
InstrumentorConfigFile.h
Go to the documentation of this file.
1//===-- Transforms/IPO/InstrumentorConfigFile.h ---------------------------===//
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// Utilities for the Instrumentor JSON configuration file.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TRANSFORMS_IPO_INSTRUMENTOR_CONFIGFILE_H
14#define LLVM_TRANSFORMS_IPO_INSTRUMENTOR_CONFIGFILE_H
15
16#include "llvm/ADT/StringRef.h"
17#include "llvm/IR/LLVMContext.h"
19
20namespace llvm {
21namespace instrumentor {
22
23/// Write the configuration in /p IConf to the file with path \p OutputFile.
24void writeConfigToJSON(InstrumentationConfig &IConf, StringRef OutputFile,
25 LLVMContext &Ctx);
26
27/// Read the configuration from the file with path \p InputFile into /p IConf.
28bool readConfigFromJSON(InstrumentationConfig &IConf, StringRef InputFile,
29 LLVMContext &Ctx, vfs::FileSystem &FS);
30
31/// Read the configuration paths from the file with path \p InputFile into \p
32/// Configs.
33bool readConfigPathsFile(StringRef InputFile, cl::list<std::string> &Configs,
34 LLVMContext &Ctx, vfs::FileSystem &FS);
35
36} // end namespace instrumentor
37} // end namespace llvm
38
39#endif // LLVM_TRANSFORMS_IPO_INSTRUMENTOR_CONFIGFILE_H
void writeConfigToJSON(InstrumentationConfig &IConf, StringRef OutputFile, LLVMContext &Ctx)
Write the configuration in /p IConf to the file with path OutputFile.
bool readConfigPathsFile(StringRef InputFile, cl::list< std::string > &Configs, LLVMContext &Ctx, vfs::FileSystem &FS)
Read the configuration paths from the file with path InputFile into Configs.
bool readConfigFromJSON(InstrumentationConfig &IConf, StringRef InputFile, LLVMContext &Ctx, vfs::FileSystem &FS)
Read the configuration from the file with path InputFile into /p IConf.
This is an optimization pass for GlobalISel generic memory operations.
The class that contains the configuration for the instrumentor.