mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Avoid deprecations with LLVM 18 wrt. renamed llvm::StringRef::{starts,ends}with()
This commit is contained in:
parent
e728075594
commit
3beb68904f
9 changed files with 70 additions and 0 deletions
|
@ -104,6 +104,10 @@ inline bool isSpace_ldc(char C) {
|
|||
} // namespace
|
||||
|
||||
static int handle(MemoryBuffer &inputBuf, StringRef input) {
|
||||
#if LDC_LLVM_VER >= 1800
|
||||
#define startswith starts_with
|
||||
#endif
|
||||
|
||||
DenseMap<StringRef, Part> partToBegin;
|
||||
StringRef lastPart, separator;
|
||||
StringRef EOL = detectEOL(inputBuf.getBuffer());
|
||||
|
@ -174,6 +178,10 @@ static int handle(MemoryBuffer &inputBuf, StringRef input) {
|
|||
for (std::unique_ptr<ToolOutputFile> &outputFile : outputFiles)
|
||||
outputFile->keep();
|
||||
return 0;
|
||||
|
||||
#if LDC_LLVM_VER >= 1800
|
||||
#undef startswith
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue