[llvm] r251181 - ScalarReplAggregates.cpp: Try to appease clash of anonymous::SROA in modules build.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 11:49:13 PST 2015


On Fri, Oct 30, 2015 at 12:18 PM, NAKAMURA Takumi <geek4civic at gmail.com>
wrote:

> It seems it might be avoided in trunk, as far as we are using the module
> LLVM_Transforms, not individual module per header.
>
> For example, ScalarReplAggregates.cpp would fail to build w/o
> -fcxx-modules with;
> +#include "llvm/Transforms/Scalar/SROA.h"
>

I'm still hoping this qualifies as a modules bug, though - it would seem
unfortunate to have to worry about all global names when choosing the name
of an entity in an anonymous namespace. I only really want to worry about
the transitive header inclusions. (though, yes, that does mean someone in a
far-flung dependency can have problems because my code depends on them not
including that header that does use a name I want to use locally... - so I
Could see the counterargument)

I think Richard provided a workaround/fix for 'local' using declarations
and typedefs that might be relevant here - but I could be
stretching/associating the wrong things together...


> I suggest s/SROA/AnyCoolName/ here. Any better idea?
>

I believe this code is hopefully going to die in the next few months
(according to a chat with Chandler I had at the dev meeting - it's mostly
superseded by the actual SROA pass, etc). Maybe we could just replace SROA
with SRA in this file? (matching the actual file number)


>
> On Tue, Oct 27, 2015 at 9:18 AM NAKAMURA Takumi <geek4civic at gmail.com>
> wrote:
>
>> I didn't have time to file the bugzilla about it in the last weekend.
>> Will do later.
>>
>> On Tue, Oct 27, 2015 at 7:17 AM David Blaikie <dblaikie at gmail.com> wrote:
>>
>>> On Mon, Oct 26, 2015 at 3:06 PM, Sean Silva <chisophugis at gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Oct 24, 2015 at 9:15 AM, David Blaikie via llvm-commits <
>>>> llvm-commits at lists.llvm.org> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Fri, Oct 23, 2015 at 11:42 PM, NAKAMURA Takumi via llvm-commits <
>>>>> llvm-commits at lists.llvm.org> wrote:
>>>>>
>>>>>> Author: chapuni
>>>>>> Date: Sat Oct 24 01:42:42 2015
>>>>>> New Revision: 251181
>>>>>>
>>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=251181&view=rev
>>>>>> Log:
>>>>>> ScalarReplAggregates.cpp: Try to appease clash of anonymous::SROA in
>>>>>> modules build.
>>>>>>
>>>>>
>>>>> Um... - where's this clashing with? Is there an anonymous namespace
>>>>> with a SROA thing in a header somewhere? That really shouldn't be there.
>>>>> What else would this be colliding with in a modules build?
>>>>>
>>>>
>>>> I think what's happening is that this is pulling in a top-level module
>>>> `LLVM_Transforms` from include/llvm/module.modulemap, which
>>>> includes llvm/Transforms/Scalar/SROA.h, which defines a class `SROA`.
>>>> There's probably a missing special case to sprinkle somewhere so that we
>>>> uphold the weird name hiding thing we do for submodules.
>>>>
>>>
>>> Yep, possibly - Mr. Smith is out on vacation this week. Hopefully he can
>>> weigh in on this next week. But I hope we don't leave that #define around
>>> for long. It's pretty awkward.
>>>
>>>
>>>>
>>>> -- Sean Silva
>>>>
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Modified:
>>>>>>     llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
>>>>>>
>>>>>> Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
>>>>>> URL:
>>>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=251181&r1=251180&r2=251181&view=diff
>>>>>>
>>>>>> ==============================================================================
>>>>>> --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
>>>>>> (original)
>>>>>> +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sat Oct
>>>>>> 24 01:42:42 2015
>>>>>> @@ -60,6 +60,7 @@ STATISTIC(NumAdjusted,  "Number of scala
>>>>>>  STATISTIC(NumConverted, "Number of aggregates converted to scalar");
>>>>>>
>>>>>>  namespace {
>>>>>> +#define SROA SROA_
>>>>>>    struct SROA : public FunctionPass {
>>>>>>      SROA(int T, bool hasDT, char &ID, int ST, int AT, int SLT)
>>>>>>        : FunctionPass(ID), HasDomTree(hasDT) {
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> llvm-commits mailing list
>>>>>> llvm-commits at lists.llvm.org
>>>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> llvm-commits mailing list
>>>>> llvm-commits at lists.llvm.org
>>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>>
>>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151102/a37b51ff/attachment.html>


More information about the llvm-commits mailing list