Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

release/21.x: [Clang] Reintroduce obsolete libclang symbols to avoid an ABI break (#149079)#149100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tru merged 1 commit intollvm:release/21.xfromllvmbot:issue149079
Jul 17, 2025

Conversation

llvmbot
Copy link
Member

Backport1600450

Requested by:@Sirraide

@llvmbot
Copy link
MemberAuthor

@AaronBallman What do you think about merging this PR to the release branch?

@llvmbotllvmbot added clangClang issues not falling into any other category clang:as-a-librarylibclang and C++ API labelsJul 16, 2025
@llvmbot
Copy link
MemberAuthor

@llvm/pr-subscribers-clang

Author: None (llvmbot)

Changes

Backport1600450

Requested by: @Sirraide


Full diff:https://github.com/llvm/llvm-project/pull/149100.diff

4 Files Affected:

  • (modified) clang/include/clang-c/Index.h (+15)
  • (modified) clang/tools/libclang/CMakeLists.txt (+1)
  • (added) clang/tools/libclang/Obsolete.cpp (+48)
  • (modified) llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn (+1)
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.hindex c35311c886413..b929585205aee 100644--- a/clang/include/clang-c/Index.h+++ b/clang/include/clang-c/Index.h@@ -6953,6 +6953,21 @@ clang_getCursorUnaryOperatorKind(CXCursor cursor);  * @}  */+CINDEX_DEPRECATED+typedef void *CXRemapping;++CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *);++CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping+clang_getRemappingsFromFileList(const char **, unsigned);++CINDEX_DEPRECATED CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping);++CINDEX_DEPRECATED CINDEX_LINKAGE void+clang_remap_getFilenames(CXRemapping, unsigned, CXString *, CXString *);++CINDEX_DEPRECATED CINDEX_LINKAGE void clang_remap_dispose(CXRemapping);+ LLVM_CLANG_C_EXTERN_C_END  #endifdiff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txtindex b6662b66206b2..2b1e266f07392 100644--- a/clang/tools/libclang/CMakeLists.txt+++ b/clang/tools/libclang/CMakeLists.txt@@ -42,6 +42,7 @@ set(SOURCES   Indexing.cpp   FatalErrorHandler.cpp   Rewrite.cpp+  Obsolete.cpp    ADDITIONAL_HEADERS   CIndexDiagnostic.hdiff --git a/clang/tools/libclang/Obsolete.cpp b/clang/tools/libclang/Obsolete.cppnew file mode 100644index 0000000000000..3596f76e1be6f--- /dev/null+++ b/clang/tools/libclang/Obsolete.cpp@@ -0,0 +1,48 @@+//===- Obsolete.cpp - Obsolete libclang functions and types -------------===//+//+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.+// See https://llvm.org/LICENSE.txt for license information.+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception+//+//===--------------------------------------------------------------------===//+//+// This file contains libclang symbols whose underlying functionality has been+// removed from Clang, but which need to be kept around so as to retain ABI+// compatibility.+//+//===--------------------------------------------------------------------===//++#include "clang-c/CXString.h"+#include "clang-c/Index.h"+#include "clang-c/Platform.h"+#include "llvm/Support/raw_ostream.h"++extern "C" {++// The functions below used to be part of the C API for ARCMigrate, which has+// since been removed from Clang; they already used to print an error if Clang+// was compiled without arcmt support, so we continue doing so.+CXRemapping clang_getRemappings(const char *) {+  llvm::errs() << "error: ARCMigrate has been removed from Clang";+  return nullptr;+}++CXRemapping clang_getRemappingsFromFileList(const char **, unsigned) {+  llvm::errs() << "error: ARCMigrate has been removed from Clang";+  return nullptr;+}++unsigned clang_remap_getNumFiles(CXRemapping) {+  llvm::errs() << "error: ARCMigrate has been removed from Clang";+  return 0;+}++void clang_remap_getFilenames(CXRemapping, unsigned, CXString *, CXString *) {+  llvm::errs() << "error: ARCMigrate has been removed from Clang";+}++void clang_remap_dispose(CXRemapping) {+  llvm::errs() << "error: ARCMigrate has been removed from Clang";+}++} // extern "C"diff --git a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gnindex 8f7beea152ab7..30b8bb61184bd 100644--- a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn+++ b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn@@ -87,6 +87,7 @@ shared_library("libclang") {     "Index_Internal.h",     "Indexing.cpp",     "Rewrite.cpp",+    "Obsolete.cpp",   ]   if (host_os == "mac") {     ldflags = [

Copy link
Collaborator

@AaronBallmanAaronBallman left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM!

We should add/update the release note to mention these are now no-op functions that have been explicitly deprecated and will be removed in the future.

@github-project-automationgithub-project-automationbot moved this fromNeeds Triage toNeeds Merge inLLVM Release StatusJul 16, 2025
…lvm#149079)For more context, seellvm#119269 (comment),but briefly, when removing ARCMigrate, I also removed some symbols inlibclang, which constitutes an ABI break that we don’t want, so this prreintroduces the removed symbols; the declarations are marked asdeprecated for future removal, and the implementations print an errorand do nothing, which is what we used to do when ARCMigrate wasdisabled.(cherry picked from commit1600450)
@trutru merged commit6ee4eed intollvm:release/21.xJul 17, 2025
@github-project-automationgithub-project-automationbot moved this fromNeeds Merge toDone inLLVM Release StatusJul 17, 2025
@github-actionsGitHub Actions
Copy link

@Sirraide (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AaronBallmanAaronBallmanAaronBallman approved these changes

Assignees
No one assigned
Labels
clang:as-a-librarylibclang and C++ APIclangClang issues not falling into any other category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants
@llvmbot@AaronBallman@tru@Sirraide

[8]ページ先頭

©2009-2025 Movatter.jp