Skip to content

Commit 3bee39c

Browse files
committed
manually cherry pick changes from llvm/llvm-project#144391
1 parent e2c380c commit 3bee39c

File tree

6 files changed

+28
-36
lines changed

6 files changed

+28
-36
lines changed

external/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -196,24 +196,20 @@ else()
196196
message(FATAL_ERROR "Unknown value for LLVM_ABI_BREAKING_CHECKS: \"${LLVM_ABI_BREAKING_CHECKS}\"!")
197197
endif()
198198

199-
# TODO: https://github.com/llvm/llvm-project/pull/144331
200-
# this change is required to support the new values of
201-
if( NOT ${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING} EQUAL 0
202-
AND NOT ${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING} EQUAL 1 )
203-
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING)
204-
if( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE" )
205-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 1 )
206-
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE_AND_ORIGIN" )
207-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 1 )
208-
set( LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING 1 )
209-
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "DISABLED" OR NOT DEFINED LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING )
210-
# The DISABLED setting is default.
211-
set( LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING 0 )
212-
else()
213-
message(FATAL_ERROR "Unknown value for LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING: \"${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}\"!")
214-
endif()
215-
endif ()
216-
# LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING (non-cached) is expected to be
199+
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING)
200+
201+
if( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE" )
202+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 1 )
203+
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE_AND_ORIGIN" )Add commentMore actions
204+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 1 )
205+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN 1 )
206+
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "DISABLED" OR NOT DEFINED LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING )
207+
# The DISABLED setting is default.
208+
set( LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 0 )
209+
else()
210+
message(FATAL_ERROR "Unknown value for LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING: \"${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}\"!")
211+
endif()
212+
# LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE (non-cached) is expected to be
217213
# 1 or 0 here, assuming referenced in #cmakedefine01.
218214

219215
if(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS)
@@ -603,10 +599,6 @@ if( MSVC )
603599
append("/WX" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
604600
endif (LLVM_ENABLE_WERROR)
605601

606-
# FIXME(kzhuravl): Need to check if it affects windows ci builds. If yes,
607-
# we might need to upstream this, possibly under a cmake option.
608-
append("/Zm20" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
609-
610602
append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
611603

612604
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

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

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

137137
/* Define to 1 to enable expensive checks for debug location coverage checking,
138138
and to 0 otherwise. */
139-
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
139+
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
140140

141141
/* Define to 1 to enable expensive tracking of the origin of debug location
142142
coverage bugs, and to 0 otherwise. */
143-
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING
143+
#cmakedefine01 LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN
144144

145145
#endif

external/llvm-project/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.

external/llvm-project/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

external/llvm-project/llvm/lib/Transforms/Utils/Debugify.cpp

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

322322
bool hasLoc(const Instruction &I) {
323323
const DILocation *Loc = I.getDebugLoc().get();
324-
#if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
324+
#if LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE
325325
DebugLocKind Kind = I.getDebugLoc().getKind();
326326
return Loc || Kind != DebugLocKind::Normal;
327327
#else

external/llvm-project/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)