Skip to content

Commit 3f79475

Browse files
authored
[build] Fixed LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING handling. (#144391)
Change in #107278 modified the CMake CACHE variable with values that are not supported for it as documented. This patch renames the derived vars so that they do not conflict with the CACHE variable.
1 parent fccab5d commit 3f79475

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,17 @@ endif()
199199
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING)
200200

201201
if( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE" )
202-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 1 )
202+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 1 )
203203
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE_AND_ORIGIN" )
204-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 1 )
205-
set( LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING 1 )
204+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 1 )
205+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN 1 )
206206
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "DISABLED" OR NOT DEFINED LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING )
207207
# The DISABLED setting is default.
208-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 0 )
208+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 0 )
209209
else()
210210
message(FATAL_ERROR "Unknown value for LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING: \"${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}\"!")
211211
endif()
212-
# LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING (non-cached) is expected to be
212+
# LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE (non-cached) is expected to be
213213
# 1 or 0 here, assuming referenced in #cmakedefine01.
214214

215215
if(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS)

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@
131131

132132
/* Define to 1 to enable expensive checks for debug location coverage checking,
133133
and to 0 otherwise. */
134-
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
134+
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
135135

136136
/* Define to 1 to enable expensive tracking of the origin of debug location
137137
coverage bugs, and to 0 otherwise. */
138-
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING
138+
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN
139139

140140
#endif

llvm/include/llvm/IR/DebugLoc.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace llvm {
2626
class DILocation;
2727
class Function;
2828

29-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
29+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
3030
// Used to represent different "kinds" of DebugLoc, expressing that the
3131
// instruction it is part of is either normal and should contain a valid
3232
// DILocation, or otherwise describing the reason why the instruction does
@@ -90,7 +90,7 @@ namespace llvm {
9090
using DebugLocTrackingRef = DILocAndCoverageTracking;
9191
#else
9292
using DebugLocTrackingRef = TrackingMDNodeRef;
93-
#endif // LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
93+
#endif // LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
9494

9595
/// A debug info location.
9696
///
@@ -117,12 +117,12 @@ namespace llvm {
117117
/// IR.
118118
LLVM_ABI explicit DebugLoc(const MDNode *N);
119119

120-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
120+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
121121
DebugLoc(DebugLocKind Kind) : Loc(Kind) {}
122122
DebugLocKind getKind() const { return Loc.Kind; }
123123
#endif
124124

125-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
125+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
126126
static inline DebugLoc getTemporary() {
127127
return DebugLoc(DebugLocKind::Temporary);
128128
}
@@ -140,7 +140,7 @@ namespace llvm {
140140
static inline DebugLoc getUnknown() { return DebugLoc(); }
141141
static inline DebugLoc getCompilerGenerated() { return DebugLoc(); }
142142
static inline DebugLoc getDropped() { return DebugLoc(); }
143-
#endif // LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
143+
#endif // LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
144144

145145
/// When two instructions are combined into a single instruction we also
146146
/// need to combine the original locations into a single location.
@@ -174,7 +174,7 @@ namespace llvm {
174174
DebugLoc orElse(DebugLoc Other) const {
175175
if (*this)
176176
return *this;
177-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
177+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
178178
if (Other)
179179
return Other;
180180
if (getKind() != DebugLocKind::Normal)
@@ -184,7 +184,7 @@ namespace llvm {
184184
return *this;
185185
#else
186186
return Other;
187-
#endif // LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
187+
#endif // LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
188188
}
189189

190190
/// Get the underlying \a DILocation.

llvm/lib/IR/DebugLoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#include "llvm/IR/DebugInfo.h"
1212
using namespace llvm;
1313

14-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
14+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
1515
DILocAndCoverageTracking::DILocAndCoverageTracking(const DILocation *L)
1616
: TrackingMDNodeRef(const_cast<DILocation *>(L)),
1717
Kind(DebugLocKind::Normal) {}
18-
#endif // LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
18+
#endif // LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
1919

2020
//===----------------------------------------------------------------------===//
2121
// DebugLoc Implementation

llvm/lib/Transforms/Utils/Debugify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ bool llvm::stripDebugifyMetadata(Module &M) {
299299

300300
bool hasLoc(const Instruction &I) {
301301
const DILocation *Loc = I.getDebugLoc().get();
302-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
302+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
303303
DebugLocKind Kind = I.getDebugLoc().getKind();
304304
return Loc || Kind != DebugLocKind::Normal;
305305
#else

llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ write_cmake_config("llvm-config") {
298298
"LLVM_BUILD_SHARED_LIBS=",
299299
"LLVM_ENABLE_TELEMETRY=",
300300
"LLVM_DEFAULT_TARGET_TRIPLE=$llvm_target_triple",
301-
"LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING=",
302-
"LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING=",
301+
"LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE=",
302+
"LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN=",
303303
"LLVM_ENABLE_DUMP=",
304304
"LLVM_ENABLE_HTTPLIB=",
305305
"LLVM_FORCE_USE_OLD_TOOLCHAIN=",

0 commit comments

Comments
 (0)