Skip to content

Commit f259306

Browse files
committed
Support LLVM 16+
1 parent e87123a commit f259306

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

build_defs/llvm_project_local.BUILD

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ cc_library(
169169
"lib/LLVMRemarks.lib",
170170
"lib/LLVMBitstreamReader.lib",
171171
"lib/LLVMBinaryFormat.lib",
172-
],
172+
] + glob([
173+
# For LLVM 16+, use glob because this file might not exist.
174+
"lib/libLLVMTargetParser.lib",
175+
]),
173176
":linux_dynamic": [
174177
":libllvm-so",
175178
],
@@ -178,7 +181,10 @@ cc_library(
178181
"lib/libLLVMRemarks.a",
179182
"lib/libLLVMBitstreamReader.a",
180183
"lib/libLLVMBinaryFormat.a",
181-
],
184+
] + glob([
185+
# For LLVM 16+, use glob because this file might not exist.
186+
"lib/libLLVMTargetParser.a",
187+
]),
182188
}),
183189
hdrs = [":llvm-headers"],
184190
includes = ["include"],

lldb-eval/context.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@
3333
#include "lldb/API/SBTypeEnumMember.h"
3434
#include "lldb/API/SBValue.h"
3535
#include "lldb/API/SBValueList.h"
36-
#include "llvm/ADT/Triple.h"
3736
#include "llvm/ADT/Twine.h"
3837
#include "llvm/Support/FormatAdapters.h"
3938
#include "llvm/Support/FormatVariadic.h"
4039

40+
#if LLVM_VERSION_MAJOR < 16
41+
#include "llvm/ADT/Triple.h"
42+
#else
43+
#include "llvm/TargetParser/Triple.h"
44+
#endif
45+
4146
namespace {
4247

4348
lldb::SBValue CreateSBValue(lldb::SBTarget target, const void* bytes,

lldb-eval/parser.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,9 +2358,9 @@ ExprResult Parser::ParseIntegerLiteral(clang::NumericLiteralParser& literal,
23582358

23592359
auto [type, is_unsigned] = PickIntegerType(*ctx_, literal, raw_value);
23602360

2361-
return std::make_unique<LiteralNode>(
2362-
token.getLocation(), ctx_->GetBasicType(type), raw_value,
2363-
/*is_literal_zero*/ raw_value.isNullValue());
2361+
return std::make_unique<LiteralNode>(token.getLocation(),
2362+
ctx_->GetBasicType(type), raw_value,
2363+
/*is_literal_zero*/ raw_value.isZero());
23642364
}
23652365

23662366
// Parse a builtin_func.

0 commit comments

Comments
 (0)