r358665 - [clang][CIndex] Use llvm::set_thread_priority

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 21 12:16:55 PDT 2019


r358858 might help with this.

On Sat, Apr 20, 2019 at 7:15 PM Nico Weber <thakis at chromium.org> wrote:

> This breaks building with LLVM_ENABLE_THREADS=OFF. The call probably needs
> to be behind a `#if LLVM_ENABLE_THREADS`.
>
> FAILED: bin/c-index-test
> ...
> lib/libclang.a(CIndex.cpp.o): In function `void llvm::function_ref<void
> ()>::callback_fn<clang_saveTranslationUnit::{lambda()#1}>(long)':
> CIndex.cpp:(.text._ZN4llvm12function_refIFvvEE11callback_fnIZ25clang_saveTranslationUnitEUlvE_EEvl+0x5a):
> undefined reference to `llvm::set_thread_priority(llvm::ThreadPriority)'
> lib/libclang.a(CIndex.cpp.o): In function
> `clang::setThreadBackgroundPriority()':
> CIndex.cpp:(.text._ZN5clang27setThreadBackgroundPriorityEv+0x27):
> undefined reference to `llvm::set_thread_priority(llvm::ThreadPriority)'
> lib/libclang.a(CIndex.cpp.o): In function `clang_saveTranslationUnit':
> CIndex.cpp:(.text.clang_saveTranslationUnit+0x316): undefined reference to
> `llvm::set_thread_priority(llvm::ThreadPriority)'
>
>
> On Thu, Apr 18, 2019 at 9:47 AM Kadir Cetinkaya via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: kadircet
>> Date: Thu Apr 18 06:49:20 2019
>> New Revision: 358665
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=358665&view=rev
>> Log:
>> [clang][CIndex] Use llvm::set_thread_priority
>>
>> Reviewers: jkorous, gribozavr
>>
>> Subscribers: dexonsmith, arphaman, cfe-commits
>>
>> Tags: #clang
>>
>> Differential Revision: https://reviews.llvm.org/D60867
>>
>> Modified:
>>     cfe/trunk/tools/libclang/CIndex.cpp
>>
>> Modified: cfe/trunk/tools/libclang/CIndex.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=358665&r1=358664&r2=358665&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/tools/libclang/CIndex.cpp (original)
>> +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Apr 18 06:49:20 2019
>> @@ -8723,9 +8723,7 @@ void clang::setThreadBackgroundPriority(
>>    if (getenv("LIBCLANG_BGPRIO_DISABLE"))
>>      return;
>>
>> -#ifdef USE_DARWIN_THREADS
>> -  setpriority(PRIO_DARWIN_THREAD, 0, PRIO_DARWIN_BG);
>> -#endif
>> +  llvm::set_thread_priority(llvm::ThreadPriority::Background);
>>  }
>>
>>  void cxindex::printDiagsToStderr(ASTUnit *Unit) {
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190421/7952ae4d/attachment-0001.html>


More information about the cfe-commits mailing list