diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-08 03:31:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-08 03:31:14 +0000 |
commit | d37a75b9be3a31691c9e492508bf0c389ad2024d (patch) | |
tree | 1801ea4f2152966dff64584ecd23861dc0c34112 /lib/Linker | |
parent | a6a2bdd0e023192b8fb31679dbde6bbb1b584547 (diff) | |
download | external_llvm-d37a75b9be3a31691c9e492508bf0c389ad2024d.zip external_llvm-d37a75b9be3a31691c9e492508bf0c389ad2024d.tar.gz external_llvm-d37a75b9be3a31691c9e492508bf0c389ad2024d.tar.bz2 |
Revert this disgusting hack, John has a much nicer solution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 02d2c18..d58acbe 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -425,20 +425,6 @@ static bool GetLinkageResult(GlobalValue *Dest, GlobalValue *Src, return false; } -// Gross hack, see call sites. -static void CoutHack(GlobalVariable *GV1, GlobalVariable *GV2) { - const Type *GV1Ty = GV1->getType()->getElementType(); - const Type *GV2Ty = GV2->getType()->getElementType(); - - if (GV1->isExternal() && isa<StructType>(GV1Ty) && - GV2->hasInitializer() && GV2->hasExternalLinkage() && - GV2->getInitializer()->isNullValue() && isa<ArrayType>(GV2Ty) && - cast<ArrayType>(GV2Ty)->getElementType() == Type::SByteTy) { - GV1->setInitializer(Constant::getNullValue(GV1Ty)); - GV2->setInitializer(0); - } -} - // LinkGlobals - Loop through the global variables in the src module and merge // them into the dest module. static bool LinkGlobals(Module *Dest, Module *Src, @@ -473,15 +459,6 @@ static bool LinkGlobals(Module *Dest, Module *Src, assert(SGV->hasInitializer() || SGV->hasExternalLinkage() && "Global must either be external or have an initializer!"); - // This is a gross hack to handle cin/cout until PR400 is implemented. If - // we are linking an external struct against a zero-initialized array of - // sbytes, move the initializer from the array to the struct so we keep the - // struct type. - if (DGV) { - CoutHack(DGV, SGV); - CoutHack(SGV, DGV); - } - GlobalValue::LinkageTypes NewLinkage; bool LinkFromSrc; if (GetLinkageResult(DGV, SGV, NewLinkage, LinkFromSrc, Err)) |