forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathcomgr-env.h
More file actions
63 lines (47 loc) · 2.18 KB
/
Copy pathcomgr-env.h
File metadata and controls
63 lines (47 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//===- comgr-env.h - Comgr environment variables --------------------------===//
//
// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See
// amd/comgr/LICENSE.TXT in this repository for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef COMGR_ENV_H
#define COMGR_ENV_H
#include "llvm/ADT/StringRef.h"
namespace COMGR {
namespace env {
/// Return whether the environment requests temps be saved.
bool shouldSaveTemps();
bool shouldSaveLLVMTemps();
std::optional<bool> shouldUseVFS();
/// If the environment requests logs be redirected, return the string identifier
/// of where to redirect. Otherwise return @p None.
std::optional<llvm::StringRef> getRedirectLogs();
/// Return whether the environment requests verbose logging.
bool shouldEmitVerboseLogs();
/// Return the raw value of AMD_COMGR_LOG_LEVEL (an integer in [0, 4]), or an
/// empty string if unset. The Logger parses this into a numeric severity
/// threshold; see COMGR::parseLogLevel.
llvm::StringRef getLogLevel();
/// Return whether the environment requests time statistics collection.
bool needTimeStatistics();
/// Return granularity (ms, us, ns) units per second
uint32_t getGranularityUnitsPerSecond();
/// Return granularity of time statistics (ms, us, ns)
llvm::StringRef getTimeStatisticsGranularity();
/// If environment variable LLVM_PATH is set, return the environment variable,
/// otherwise return the default LLVM path.
llvm::StringRef getLLVMPath();
/// If environment variable AMD_COMGR_CACHE_POLICY is set, return the
/// environment variable, otherwise return empty
llvm::StringRef getCachePolicy();
/// If environment variable AMD_COMGR_CACHE_DIR is set, return the environment
/// variable, otherwise return the default path: On Linux it's typically
/// $HOME/.cache/comgr_cache (depends on XDG_CACHE_HOME)
llvm::StringRef getCacheDirectory();
/// If environment variable AMD_COMGR_DRIVER_OPTIONS_APPEND is set, return the
/// space-separated options to append to clang driver invocations.
llvm::StringRef getDriverOptionsAppend();
} // namespace env
} // namespace COMGR
#endif // COMGR_ENV_H