[llvm-commits] [llvm-gcc-4.0] r41279 - /llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
Chris Lattner
clattner at apple.com
Wed Aug 22 12:19:15 PDT 2007
On Aug 22, 2007, at 10:22 AM, Andrew Lenharth wrote:
> fix PR1586
This breaks llvm.used due to this code in AsmPrinter:
bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
// Ignore debug and non-emitted data.
if (GV->getSection() == "llvm.metadata") return true;
if (!GV->hasAppendingLinkage()) return false;
assert(GV->hasInitializer() && "Not a special LLVM global!");
if (GV->getName() == "llvm.used") {
if (TAI->getUsedDirective() != 0) // No need to emit this at
all.
EmitLLVMUsedList(GV->getInitializer());
return true;
}
Please revert the patch or fix it, thanks!
-Chris
>
> Modified:
> llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
>
> Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/
> llvm-backend.cpp?rev=41279&r1=41278&r2=41279&view=diff
>
> ======================================================================
> ========
> --- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
> +++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Wed Aug 22 12:22:11 2007
> @@ -483,8 +483,10 @@
> const Type *SBP = PointerType::get(Type::Int8Ty);
> ArrayType *AT = ArrayType::get(SBP, AttributeUsedGlobals.size());
> Constant *Init = ConstantArray::get(AT, AttributeUsedGlobals);
> - new GlobalVariable(AT, false, GlobalValue::AppendingLinkage,
> Init,
> + GlobalValue* gv = new GlobalVariable(AT, false,
> + GlobalValue::AppendingLinkage, Init,
> "llvm.used", TheModule);
> + gv->setSection("llvm.metadata");
> AttributeUsedGlobals.clear();
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list