-// RequiresUnique - Returns true if the global variable needs to be
-// unique. I.e., there shouldn't be a new global variable created in the
-// destination Module, rather the source variable's initializer needs to be
-// identical to the destination variable's initializer.
-static bool RequiresUnique(const GlobalVariable *SGV,
- const GlobalVariable *DGV) {
- const StringRef SrcSec(SGV->getSection());
- const StringRef DstSec(DGV->getSection());
-
- // The Objective-C __image_info section should be unique.
- if (SrcSec == DstSec &&
- (SrcSec.find("__objc_imageinfo") != StringRef::npos ||
- SrcSec.find("__image_info") != StringRef::npos))
- return true;
-
- return false;
-}
-