[PATCH] llvm-ar shouldn't need targets

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 30 12:38:21 PDT 2015


It needs to be able to parse assembly in order to populate the symbol
table. No tests fail with this? I will add one if so.

On 29 April 2015 at 20:08, Chris Bieneman <beanz at apple.com> wrote:
> Hi rafael, chandlerc,
>
> There isn't any code in llvm-ar that actually uses targets, but it links them because it calls a few InitializeAll* functions. If we remove those calls, we can remove the dependency on the targets, which makes building llvm-ar a lot faster.
>
> http://reviews.llvm.org/D9359
>
> Files:
>   tools/llvm-ar/CMakeLists.txt
>   tools/llvm-ar/llvm-ar.cpp
>
> Index: tools/llvm-ar/CMakeLists.txt
> ===================================================================
> --- tools/llvm-ar/CMakeLists.txt
> +++ tools/llvm-ar/CMakeLists.txt
> @@ -1,5 +1,4 @@
>  set(LLVM_LINK_COMPONENTS
> -  ${LLVM_TARGETS_TO_BUILD}
>    Core
>    Object
>    Support
> Index: tools/llvm-ar/llvm-ar.cpp
> ===================================================================
> --- tools/llvm-ar/llvm-ar.cpp
> +++ tools/llvm-ar/llvm-ar.cpp
> @@ -1043,10 +1043,6 @@
>      "  This program archives bitcode files into single libraries\n"
>    );
>
> -  llvm::InitializeAllTargetInfos();
> -  llvm::InitializeAllTargetMCs();
> -  llvm::InitializeAllAsmParsers();
> -
>    StringRef Stem = sys::path::stem(ToolName);
>    if (Stem.find("ar") != StringRef::npos)
>      return ar_main();
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/



More information about the llvm-commits mailing list