[PATCH] Fix for nasty LTO issue that's most obvious in ObjectiveC.

Kevin Frei freik at fb.com
Thu Nov 6 12:39:52 PST 2014


Fair enough. I'll go ahead & update the diff with the fix moved into copyAttributesFrom, and fix up handful of missing attributes in GlobalObject and GlobalValue, too.

-----Original Message-----
From: Rafael EspĂ­ndola [mailto:rafael.espindola at gmail.com] 
Sent: Thursday, November 06, 2014 12:22 PM
To: reviews+D6145+public+f51221c9eae85dd9 at reviews.llvm.org
Cc: Kevin Frei; Saleem Abdulrasool; David Majnemer; Reid Kleckner; llvm-commits
Subject: Re: [PATCH] Fix for nasty LTO issue that's most obvious in ObjectiveC.

On 6 November 2014 12:22, Kevin Frei <freik at fb.com> wrote:
> The reason I wasn't sure which was correct is because isExternallyIntialized is a default ctor parameter, so if someone's specifying a different value, then calling the copyAttributesFrom to fill in everything else, it's a bug. From a design perspective, having an API like copyAttributesFrom for a type with a ctor that has default parameters seems incredibly confusing. Perhaps I should eliminate the default parameter? And maybe this discussion should move over to llvmdev?

copyAttributesFrom is used when two GV are being merged or one is being copied. The default constructor options are just a convenience for when one value is more common than others, so the two seem unrelated.

Cheers,
Rafael




More information about the llvm-commits mailing list