[llvm] r221050 - Remove redundant calls to isMaterializable.

Pasi Parviainen pasi.parviainen at iki.fi
Sat Nov 1 15:59:46 PDT 2014


On 1.11.2014 18:46, Rafael Espindola wrote:
> Author: rafael
> Date: Sat Nov  1 11:46:18 2014
> New Revision: 221050
>
> URL: http://llvm.org/viewvc/llvm-project?rev=221050&view=rev
> Log:
> Remove redundant calls to isMaterializable.
>
> This removes calls to isMaterializable in the following cases:
>
> * It was redundant with a call to isDeclaration now that isDeclaration returns
>    the correct answer for materializable functions.
> * It was followed by a call to Materialize. Just call Materialize and check EC.
>
> Modified:
>      llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
>      llvm/trunk/lib/IR/LegacyPassManager.cpp
>      llvm/trunk/lib/IR/Verifier.cpp
>      llvm/trunk/lib/Linker/LinkModules.cpp
>      llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp
>      llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
>      llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp
>      llvm/trunk/lib/Target/X86/X86Subtarget.cpp
>      llvm/trunk/tools/gold/gold-plugin.cpp
>      llvm/trunk/tools/llvm-extract/llvm-extract.cpp
>
> Modified: llvm/trunk/tools/gold/gold-plugin.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=221050&r1=221049&r2=221050&view=diff
> ==============================================================================
> --- llvm/trunk/tools/gold/gold-plugin.cpp (original)
> +++ llvm/trunk/tools/gold/gold-plugin.cpp Sat Nov  1 11:46:18 2014
> @@ -471,10 +471,8 @@ static GlobalObject *makeInternalReplace
>     Module *M = GO->getParent();
>     GlobalObject *Ret;
>     if (auto *F = dyn_cast<Function>(GO)) {
> -    if (F->isMaterializable()) {
> -      if (F->materialize())
> -        message(LDPL_FATAL, "LLVM gold plugin has failed to read a function");
> -
> +    if (F->materialize())
> +      message(LDPL_FATAL, "LLVM gold plugin has failed to read a function");
>       }

This part introduces a build failure in the gold plugin. Seems like you 
forgot to remove closing brace for the removed if statement.

>       auto *NewF = Function::Create(F->getFunctionType(), F->getLinkage(),
>




More information about the llvm-commits mailing list