[llvm-dev] How to get CLang array alloca alignments to be smaller than 16 bytes?

Joan Lluch via llvm-dev llvm-dev at lists.llvm.org
Sun May 5 13:48:58 PDT 2019

Hi Tim

I created an Xcode project with CMAKE, which should have the entire lot of files. Selecting the ‘install’ scheme Xcode compiles everything including all available targets for clang and llc, which then I can fully debug. So the Xcode project definitely has all the cpp files in it. 

However, I now have found that for some reason the .h files in the lib/Basic/Targets directory were not included as part of the Xcode project. This is kind of weird, as this is the only case that I found of .h files not being added to the project. I assume this is a bug on one of the cmake install files. The entire thing compiles anyway because the compiler finds the .h files as they are included in the .cpp source.

I have been performing all searches in the convenience of the xCode environment, and since these particular files were missing from the project they didn’t appear in any searches. I suppose this can be reported as a bug of the Cmake configuration files for xCode.


> On 5 May 2019, at 22:01, Tim Northover <t.p.northover at gmail.com> wrote:
> On Sun, 5 May 2019 at 19:41, Joan Lluch <joan.lluch at icloud.com> wrote:
>> “LargeArrayMinWidth” is only on the following files:
>> TargetInfo.cpp
>> TargetInfo.h
> OK, so I've downloaded the official Clang released source
> (https://releases.llvm.org/7.0.0/cfe-7.0.0.src.tar.xz), and:
> $ tar xvf Downloads/cfe-7.0.0.src.tar.xz
> [...]
> $ cd cfe-7.0.0.src/
> $ grep -r LargeArrayMinWidth .
> ./include/clang/Basic/TargetInfo.h:  unsigned char LargeArrayMinWidth,
> LargeArrayAlign;
> ./include/clang/Basic/TargetInfo.h:  // getLargeArrayMinWidth/Align -
> Return the minimum array size that is
> ./include/clang/Basic/TargetInfo.h:  unsigned getLargeArrayMinWidth()
> const { return LargeArrayMinWidth; }
> ./lib/Basic/TargetInfo.cpp:  LargeArrayMinWidth = 0;
> ./lib/Basic/Targets/Hexagon.h:    LargeArrayMinWidth = 64;
> ./lib/Basic/Targets/NVPTX.cpp:  // - LargeArrayMinWidth,
> LargeArrayAlign: Not visible across the
> ./lib/Basic/Targets/X86.h:    LargeArrayMinWidth = 128;
> ./lib/Basic/Targets/WebAssembly.h:    LargeArrayMinWidth = 128;
> ./lib/AST/ASTContext.cpp:        unsigned MinWidth =
> Target->getLargeArrayMinWidth();
> I'm afraid I don't know what actually is happening here, but I think
> the best explanation has to be that you're not actually looking at
> Clang 7.0 source. That would definitely be my primary line of
> investigation.
> Cheers.
> Tim.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190505/9ed9fdc8/attachment.html>

More information about the llvm-dev mailing list