[cfe-users] How to create TranslationUnit for source code?

2019-04-08 Thread Kirill Bugaev via cfe-users
I write program which determines type of instance under cursor in source code. I pass on ast-file and cursor location as cmd arguments and output instance location(line number and column) and its type. #include > #include > #include > int main(int argc, char *argv[]) > { > CXIndex index; >

[cfe-users] how to verify downloads without public key?

2019-04-12 Thread Larry Evans via cfe-users
I've just downloaded: http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz.sig but when I tried to verify the download with: gpg2 --verify clang+llvm-8.0.0-x86_64-linux-gnu-ubunt

Re: [cfe-users] how to verify downloads without public key?

2019-04-12 Thread Matthew Fernandez via cfe-users
> On Apr 12, 2019, at 04:10, Larry Evans via cfe-users > wrote: > > I've just downloaded: > > http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz > http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz

[cfe-users] Relocating prebuilt modules

2019-04-12 Thread Alexandre Rames via cfe-users
Hello there, I am looking for some help with how to relocate prebuilt modules. My desired workflow is: - prebuild modules on host - copy modules to a target - use the prebuilt modules on target through `-fprebuilt-module-path`. My attempts are failing, as it seems the absolute path to the modules

[cfe-users] No access to gcc30{0,1,2,3}.fsffrance.org

2019-04-12 Thread Aleksey Cheusov via cfe-users
It seems to me there is no access to gcc30{0,1,2,3} machines. What am I doing wrong? Are they running? ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

[cfe-users] clang-format support for K&R styled function parameter lists

2019-04-18 Thread Marco Wegner via cfe-users
I have old C code and would like to reformat it with clang-format. One problem im facing is, many of old functions are written with K&R parameter initializer lists. And clang-format does a strange reformatting on these lines. For example following original code: int tz_start_new( nr, start,

[cfe-users] How to have clang ignore gch directories?

2019-04-23 Thread Paul Smith via cfe-users
How can I get clang to stop caring about gch directories for precompiled headers that were created by GCC? Currently my main build uses GCC and it generates .gch directories: $ ls -1d foo_pch* foo_pch.h foo_pch.h.gch/ When I compile my code using GCC, it works fine: $ g++ ... -Winvalid-

Re: [cfe-users] How to have clang ignore gch directories?

2019-04-25 Thread Richard Smith via cfe-users
On Tue, 23 Apr 2019 at 12:06, Paul Smith via cfe-users wrote: > > How can I get clang to stop caring about gch directories for > precompiled headers that were created by GCC? > > Currently my main build uses GCC and it generates .gch directories: > > $ ls -1d f

Re: [cfe-users] How to have clang ignore gch directories?

2019-04-25 Thread Paul Smith via cfe-users
On Thu, 2019-04-25 at 14:38 -0700, Richard Smith wrote: > > How can I tell clang to just ignore the GCC-specific precompiled > > headers, or equivalently ignore precompiled headers altogether? I > > can't delete the gch directories because I need them for my build. I've > > read through the clang

[cfe-users] How to use clang-apply-replacements with clang-tidy fixit file

2019-04-26 Thread Robert Ankeney via cfe-users
I used clang-tidy to generate some replacements for a code base into a yaml file using the -export-fixits=file option. After editing the file to remove some unwanted changes, I would like to apply those fixes. The documentation says to use clang-apply-replacements, but I don't see how do use it to

Re: [cfe-users] How to use clang-apply-replacements with clang-tidy fixit file

2019-04-26 Thread Christian Gagneraud via cfe-users
On Sat, 27 Apr 2019 at 07:20, Robert Ankeney via cfe-users wrote: > > I used clang-tidy to generate some replacements for a code base into a yaml > file using the -export-fixits=file option. After editing the file to remove > some unwanted changes, I would like to apply thos

Re: [cfe-users] How to use clang-apply-replacements with clang-tidy fixit file

2019-04-26 Thread Christian Gagneraud via cfe-users
Back on the ML., let's keep the discussion public and archived. On Sat, 27 Apr 2019 at 09:11, Christian Gagneraud wrote: > > On Sat, 27 Apr 2019 at 09:01, Robert Ankeney wrote: > > > > Hi Chris, > > > > Thanks for the fast response! As it turns out, I was doing that, but found > > that there mu

Re: [cfe-users] How to use clang-apply-replacements with clang-tidy fixit file

2019-04-29 Thread Robert Ankeney via cfe-users
I used the run-clang-tidy script to operate across a large compilation database using: run-clang-tidy.py -header-filter=.* -checks=-*,-cppcoreguidelines-pro-type-member-init -export-fixes=ctinit.yaml This generated a large YAML fixit file. I've since edited the file to remove and/or change some o

[cfe-users] LLVM / Clang 8 Compilation of OpenMP Code in Windows

2019-05-04 Thread Royi Avital via cfe-users
Hello, I have an issue using OpenMP with Clang 8 under Windows.I descried the issue in  https://stackoverflow.com/questions/55976484 and I'd like to describe it here more carefully and specifically. Let's say I run those 2 commands to compile a simple code: clang-cl -Xclang -fopenmp -o bla.obj -c

[cfe-users] Fwd: Re: [llvm-dev] Overriding macro values defined in source code

2019-05-08 Thread Sudhindra kulkarni via cfe-users
-- Forwarded message -- From: "Tim Northover" Date: May 1, 2019 3:48 PM Subject: Re: [llvm-dev] Overriding macro values defined in source code To: "Sudhindra kulkarni" Cc: "LLVM Developers Mailing List" On Tue, 30 Apr 2019 at 22:28, Sudhindra kulkarni via llvm-dev wrote: > Is i

Re: [cfe-users] Fwd: Re: [llvm-dev] Overriding macro values defined in source code

2019-05-08 Thread Richard Smith via cfe-users
On Mon, 6 May 2019 at 23:09, Sudhindra kulkarni via cfe-users wrote: > > > -- Forwarded message -- > From: "Tim Northover" > Date: May 1, 2019 3:48 PM > Subject: Re: [llvm-dev] Overriding macro values defined in source code > To: "Sudhind

Re: [cfe-users] Fwd: Re: [llvm-dev] Overriding macro values defined in source code

2019-05-10 Thread Richard Smith via cfe-users
; > > > > > On May 9, 2019 5:01 AM, "Richard Smith" wrote: > > On Mon, 6 May 2019 at 23:09, Sudhindra kulkarni via cfe-users > wrote: > > > > > > -- Forwarded message -- > > From: "Tim Northover" > > Date:

[cfe-users] Using clang LTO with POLLY

2019-05-13 Thread Brandon Simmons via cfe-users
I'm hacking on a compiler with a fairly complicated build system and trying to experiment with POLLY (https://polly.llvm.org) alongside LLVM LTO. The general shape of the last part of compilation looks like: opt-6.0 -O2 -enable-tbaa -tbaa '-relocation-model=static' application.ll -o applicati

Re: [cfe-users] Fwd: Re: [llvm-dev] Overriding macro values defined in source code

2019-05-13 Thread Sudhindra kulkarni via cfe-users
Thanks in advance On May 9, 2019 5:01 AM, "Richard Smith" wrote: On Mon, 6 May 2019 at 23:09, Sudhindra kulkarni via cfe-users wrote: > > > -- Forwarded message -- > From: "Tim Northover" > Date: May 1, 2019 3:48 PM > Subject: Re: [llv

Re: [cfe-users] Fwd: Re: [llvm-dev] Overriding macro values defined in source code

2019-05-13 Thread Sudhindra kulkarni via cfe-users
file" effect. > Thanks in advance > > > > > > > > On May 9, 2019 5:01 AM, "Richard Smith" wrote: > > On Mon, 6 May 2019 at 23:09, Sudhindra kulkarni via cfe-users > wrote: > > > > > > -- Forwarded message -- > &g

[cfe-users] Can I do a conditional jump without variables using phi?

2019-05-17 Thread Levo DeLellis via cfe-users
Lets take this C code. Obviously, it will always print out normal value int main() { for(int i=0; i<2; i++) { if(i>4) put("High value") else put("Normal value") } return 0; } Lets say I want the first time it runs this loop to go through the nor

[cfe-users] clang_createTranslationUnitFromSourceFile() and C++ source code

2019-05-31 Thread Kirill Bugaev via cfe-users
I am trying to determine data types in C++ source code with help of libclang. My program is = #include #include #include int main(int argc, char *argv[]) { CXIndex index; CXTranslationUnit tu; CXFile file; CXSourceLocation loc; CXCursor cursor, def; CXType type;

[cfe-users] llvm-mca markers prevent loop vectorization

2019-06-05 Thread Max Marrone via cfe-users
The docs for llvm-mca suggest using inline assembly to mark the region that llvm-mca should examine, i.e. __asm volatile("# LLVM-MCA-BEGIN"); // ... __asm volatile("# LLVM-MCA-END"); However, these di

Re: [cfe-users] llvm-mca markers prevent loop vectorization

2019-06-05 Thread Simon Pilgrim via cfe-users
This is a known (but poorly documented) issue. Please can you raise a bug on this? On 05/06/2019 18:43, Max Marrone via cfe-users wrote: The docs for llvm-mca <https://llvm.org/docs/CommandGuide/llvm-mca.html#using-markers-to-analyze-specific-code-blocks> suggest using inline assembly t

Re: [cfe-users] llvm-mca markers prevent loop vectorization

2019-06-10 Thread Max Marrone via cfe-users
I can't figure out a good way to reply to this list from the archive, but, for posterity, bug reported here: https://bugs.llvm.org/show_bug.cgi?id=42173 ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[cfe-users] General Question

2019-06-19 Thread Steven Truppe via cfe-users
Hi everyone, i want to use clang to create some kind of graphical programming language where you have nodes with atomic operations that you can connect (think of a node like a function with parameter and in and output nodes). now i found out clang creates the AST, how can i create my own AST so

Re: [cfe-users] General Question

2019-06-19 Thread Steven Truppe via cfe-users
i'm writing a project where i want to have a graphical interface and be able to use nodes (think of nodes like functions) with in and output slots. where do i have to start to create my own AST and then execute it at runtime ? On 19.06.19 16:20, Steven Truppe via cfe-users wrote: Hi eve

Re: [cfe-users] General Question

2019-06-19 Thread Steven Truppe via cfe-users
When i've created my own ast - how can i run the code in realtime ? On 19.06.19 16:49, Steven Truppe via cfe-users wrote: i'm writing a project where i want to have a graphical interface and be able to use nodes (think of nodes like functions) with in and output slots. where do i hav

[cfe-users] Question about clang documentation or better a book

2019-06-20 Thread Steven Truppe via cfe-users
Hi everyone, i'm new to clang and i need to parse C++ code that can use custom c++ functions/variables i write myself and then i need a way to create my own AST that has access to the own defined functions/variables. I was not able to find a book about clang and my llvm book talks to less about

[cfe-users] clang-cl 8.0 (x86) - pdb

2019-06-26 Thread Leo Brugnara via cfe-users
Hi, I've come across the following issue with Clang 8.0 under Windows 10 (Home - Version 10.0.17134 Build 17134) using clang's cl driver. I have the following snippet of code that uses *double*: #include int main (int argc, char **argv) { int size = 60; printf("size=%d\n", size); d

[cfe-users] DWARF bit field offset wrong values in LLVM

2019-07-01 Thread Trevor Harrison via cfe-users
I'm trying to extract information about bitfields in a structure using DWARF info. The info generated by LLVM seems to be incorrect and not following the DWARF standard. If this isn't the right mailing list, please let me know. If you look at DwarfUnit.cpp in the current LLVM src, it is using DI

Re: [cfe-users] DWARF bit field offset wrong values in LLVM

2019-07-01 Thread Trevor Harrison via cfe-users
Yeah, ignore my ramblings. LLVM is fine, I was visually confusing the pre-dwarf4 bit_offset attribute value with new hotness of data_bit_offset. Thanks Matthew for the cfe-dev suggestion. On Mon, Jul 1, 2019 at 12:17 PM Trevor Harrison wrote: > I'm trying to extract information about bitfields

[cfe-users] thinlto and c++ static initialization analysis

2019-07-18 Thread Jerry Scharf via cfe-users
I am looking at trying out thinlto on our large c++ programs. We have had to do a bunch of careful things to make sure things get linked in the right order to get the static initialization to work right. Two questions: Will thinlto honor the command line ordering of files that we set? In theo

Re: [cfe-users] thinlto and c++ static initialization analysis

2019-07-18 Thread Christian Gagneraud via cfe-users
On Thu, 18 Jul 2019 at 21:15, Jerry Scharf via cfe-users wrote: > > I am looking at trying out thinlto on our large c++ programs. We have > had to do a bunch of careful things to make sure things get linked in > the right order to get the static initialization to work right. >

Re: [cfe-users] Getting underlying type for `using typename` declaration

2019-07-22 Thread Richard Smith via cfe-users
On Wed, 17 Jul 2019 at 23:20, Victor “LOST” Milovanov via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi CFE users! > > > > I am trying to get a `QualType` instance from > `UnresolvedUsingTypenameDecl`. Unlike `TypeAliasDecl` > `UnresolvedUsingTypenameDecl` does no

[cfe-users] clang-cl choosing VC++ backend on Windows

2019-07-22 Thread Edward Diener via cfe-users
Given multiple installations installed of Visual Studio/VC++ on Windows, with none of them normally in the PATH, how does clang-cl choose which one to use at compile/link time as the clang backend ? ___ cfe-users mailing list cfe-users@lists.llvm.org

[cfe-users] clang-cl choosing VC++ backend on Windows

2019-07-22 Thread Edward Diener via cfe-users
Given multiple installations installed of Visual Studio on Windows, with none of them normally in the PATH, how does clang-cl choose which one to use at compile/link time as the VC++ backend ? ___ cfe-users mailing list cfe-users@lists.llvm.org https:

[cfe-users] clang+MinGW issue with float.h

2019-07-23 Thread Harry Wagstaff via cfe-users
Hi all, I have a simple program which I can successfully compile with clang, using MinGW's C/C++ Library: #include int main(int argc, char **argv) { printf("Hello world!\n"); return 0; } I am able to compile this with mingw-gcc successfully: $ gcc test.c -o test $ ./test Hello world! I am a

Re: [cfe-users] clang-cl choosing VC++ backend on Windows

2019-07-25 Thread Hans Wennborg via cfe-users
On Mon, Jul 22, 2019 at 3:29 PM Edward Diener via cfe-users wrote: > > Given multiple installations installed of Visual Studio/VC++ on Windows, > with none of them normally in the PATH, how does clang-cl choose which > one to use at compile/link time as the clang backend ? It'

[cfe-users] Should clang++ -g produce debugging info for all types?

2019-07-25 Thread Bob Eastbrook via cfe-users
On Fedora 30, "clang++ -g main.cc" does not emit debugging information for types such as std::string. I can only get complete debugging information by including "-fno-limit-debug-info". On Ubuntu 19.04, "clang++ -g" emits debugging info for std::string as expected. Which behavior of "-g" is corr

Re: [cfe-users] Should clang++ -g produce debugging info for all types?

2019-07-25 Thread David Blaikie via cfe-users
definition. (& here's a lightning talk that discusses, briefly, some of this: https://www.youtube.com/watch?v=XvkLHIASlp8 ) On Thu, Jul 25, 2019 at 11:41 AM Bob Eastbrook via cfe-users < cfe-users@lists.llvm.org> wrote: > On Fedora 30, "clang++ -g main.cc" does not emit

Re: [cfe-users] Should clang++ -g produce debugging info for all types?

2019-07-30 Thread Bob Eastbrook via cfe-users
On Thu, Jul 25, 2019 at 8:35 PM David Blaikie wrote: > No, it shouldn't - clang attempts to avoid emitting duplicate debug info > across the program (it assumes you built the whole program and all libraries > with debug info), gcc assumes the same thing though in slightly > different/fewer way

Re: [cfe-users] [clang-format] Trailing return type

2019-07-30 Thread Mateusz Loskot via cfe-users
On Mon, 5 Nov 2018 at 19:27, Mateusz Loskot wrote: > On Fri, 2 Nov 2018 at 06:11, Owen Pan wrote: > > I noticed one issue which I wonder if it does qualify for a bug report: > > TL;TR: arrow followed by typename keyword is not handled > > Before: > > template > auto bbb(detai

Re: [cfe-users] [clang-format] Trailing return type

2019-07-30 Thread Mateusz Loskot via cfe-users
On Wed, 31 Jul 2019 at 00:14, Mateusz Loskot wrote: > On Mon, 5 Nov 2018 at 19:27, Mateusz Loskot wrote: > > On Fri, 2 Nov 2018 at 06:11, Owen Pan wrote: > > > > I noticed one issue which I wonder if it does qualify for a bug report: > > > > TL;TR: arrow followed by typename keyword is not handl

[cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-07-30 Thread Ayush Mittal via cfe-users
Hello Clangers, I'm new to clang. I'm writing an AST Consumer plug-in to visit the statements node and record the data in one of my table with line numbers. I've this function callback ready: *VisitStmt(Stmt *S)*. My question is how could I traverse If, while, for loop, boolean and Unary Operators

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-07-30 Thread Richard Trieu via cfe-users
re interested in. Hope this is enough to get you started. On Tue, Jul 30, 2019 at 4:25 PM Ayush Mittal via cfe-users < cfe-users@lists.llvm.org> wrote: > Hello Clangers, > > I'm new to clang. I'm writing an AST Consumer plug-in to visit the > statements node and record th

[cfe-users] [clang-include-fixer]

2019-07-31 Thread Achilles Theodorakopoulos via cfe-users
Hi all, I'd like to share something I believe is incorrect behavior (bug?) of find-all-symbols from the clang-include-fixer Consider the following header (filename is Type.h) /* - */ #ifndef _TYPE_H #define _TYPE_H typedef struct SomeType { int a; int b; } Some

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-01 Thread Richard Trieu via cfe-users
orrect type without checking while dyn_cast does check the target >> type and returns a null pointer on a type mismatch. Chains of dyn_cast's >> are used if the list of nodes is short while using a switch on >> Stmt::getStmtClass() is used when checking a lot of node typ

[cfe-users] clang-format: break before brace in multiline conditionals

2019-08-01 Thread Nikos Chantziaras via cfe-users
Is there a way to make clang-format either add a line break before the brace in this case, or at least indent the continuation line by a higher amount of spaces than normal? This is my issue: if (auto it = files_by_name_.find(file_name); it != files_by_name_.end()) { file_name =

Re: [cfe-users] How to get code for a function template specialization

2019-08-04 Thread Richard Smith via cfe-users
On Fri, 2 Aug 2019 at 15:05, Romulo via cfe-users wrote: > Hello there, thanks for your time reading this :) > > I am trying to extract the code for a specialized template function, but I > have no idea on how to proceed. I know I can use SourceManager to get the > original '

Re: [cfe-users] Should clang++ -g produce debugging info for all types?

2019-08-05 Thread David Blaikie via cfe-users
Does it work with gdb? I'm guessing maybe lldb doesn't support the build-id feature that redhat uses ( https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/developer_guide/intro.debuginfo ) ? I'd try gdb + gcc + binutils ld (or gold) + libstdc++ (use std::fstream as an exa

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-06 Thread Ayush Mittal via cfe-users
here >>> } >>> } >>> >>> The difference between cast and dyn_cast is that cast expects the >>> pointer is the correct type without checking while dyn_cast does check the >>> target type and returns a null pointer on a type mismatch. Chains of

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-06 Thread Richard Trieu via cfe-users
; } else if (UnaryOperator *UO = dyn_cast(S)) { >>>> ... >>>> } // other checks here >>>> } >>>> >>>> void VisitStmt(Stmt *S) { >>>> switch (S->getStmtClass()) { >>>> case Stmt::BinaryOperatorClass: { >>

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-07 Thread Ayush Mittal via cfe-users
st and >>>>> dyn_cast functions and Stmt::getStmtClass() will tell the type of the >>>>> Stmt. They are used as follows: >>>>> >>>>> void VisitStmt(Stmt *S) { >>>>> if (BinaryOperator *BO = dyn_cast(S)) { >>&g

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-07 Thread Richard Trieu via cfe-users
of Stmt. There's also two other related classes, >>>>>> CXXForRangeStmt and DoStmt, which represent ranged-based for-loops and >>>>>> do/while loops. >>>>>> >>>>>> Second, pointers can be changed between classes with the

[cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-09 Thread Chris Hall via cfe-users
I find that __builtin_constant_p() works as expected, but __has_builtin(constant_p) denies it ! Similarly __builtin_expect() and __builtin_types_compatible_p() ! Can I just assume these are all supported by all version of clang ? Chris ___ cfe-user

Re: [cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-09 Thread Matthew Fernandez via cfe-users
> On Aug 9, 2019, at 05:23, Chris Hall via cfe-users > wrote: > > > I find that __builtin_constant_p() works as expected, but > __has_builtin(constant_p) denies it ! I believe you need __has_builtin(__builtin_constant_p). > > Similarly __builtin_expect() and __bu

Re: [cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-09 Thread Chris Hall via cfe-users
On 09/08/2019 15:00, Matthew Fernandez wrote: On Aug 9, 2019, at 05:23, Chris Hall via cfe-users wrote: I find that __builtin_constant_p() works as expected, but __has_builtin(constant_p) denies it ! I believe you need __has_builtin(__builtin_constant_p). Ah :-(  So you do... sorry... I

Re: [cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-09 Thread Richard Smith via cfe-users
On Fri, 9 Aug 2019 at 10:32, Chris Hall via cfe-users < cfe-users@lists.llvm.org> wrote: > On 09/08/2019 15:00, Matthew Fernandez wrote: > >> On Aug 9, 2019, at 05:23, Chris Hall via cfe-users wrote: > >> > >> I find that __builtin_constant_p() works as expecte

Re: [cfe-users] Should clang++ -g produce debugging info for all types?

2019-08-09 Thread Bob Eastbrook via cfe-users
On Mon, Aug 5, 2019 at 1:36 PM David Blaikie wrote: > Does it work with gdb? It works with gdb. More info: g++ & gdb -- works, even without debuginfo for libstdc++ clang++ & gdb -- works g++ & lldb -- works clang++ & lldb -- fails I now notice these warnings in lldb after installing the debug

Re: [cfe-users] Should clang++ -g produce debugging info for all types?

2019-08-09 Thread David Blaikie via cfe-users
On Fri, Aug 9, 2019 at 6:03 PM Bob Eastbrook wrote: > On Mon, Aug 5, 2019 at 1:36 PM David Blaikie wrote: > > > Does it work with gdb? > > It works with gdb. More info: > > g++ & gdb -- works, even without debuginfo for libstdc++ > ^ for std::string I'd expect this. For std::fstream, I expect

Re: [cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-09 Thread Matthew Fernandez via cfe-users
> On Aug 9, 2019, at 14:58, Richard Smith via cfe-users > wrote: > > On Fri, 9 Aug 2019 at 10:32, Chris Hall via cfe-users > mailto:cfe-users@lists.llvm.org>> wrote: > On 09/08/2019 15:00, Matthew Fernandez wrote: > >> On Aug 9, 2019, at 05:23, Chris Hall via

Re: [cfe-users] __builtin_constant_p(), __builtin_expect() and __builtin_types_compatible_p() and __has_builtin()

2019-08-12 Thread Richard Smith via cfe-users
On Fri, 9 Aug 2019 at 19:48, Matthew Fernandez wrote: > On Aug 9, 2019, at 14:58, Richard Smith via cfe-users < > cfe-users@lists.llvm.org> wrote: > > On Fri, 9 Aug 2019 at 10:32, Chris Hall via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> On 09/08

[cfe-users] Porting preprocessor macros to be compatible with clang

2019-08-20 Thread Forumer 4umer via cfe-users
Hello, I am sorry to ask for some help on this subject but I am not very comfortable with preprocessor and especially with the differences between compilers. We have some (ugly) macros used to generate some data structures and methods that works fine on Visual but I would like to use clang to

Re: [cfe-users] Porting preprocessor macros to be compatible with clang

2019-08-20 Thread Matthew Fernandez via cfe-users
> On Aug 20, 2019, at 07:27, Forumer 4umer via cfe-users > wrote: > > Hello, > > I am sorry to ask for some help on this subject but I am not very comfortable > with preprocessor and especially with the differences between compilers. > We have some (ugly) macros us

Re: [cfe-users] Porting preprocessor macros to be compatible with clang

2019-08-21 Thread Forumer 4umer via cfe-users
So a bit more explanation, the macros are used to generate data structure and methods and the following definition is used to declare a structure: DEF_STRUCT(namedDate, namedDate, (std::string, name), (std::time_t, date)) On visual when I look at preprocessed file I get this (focus on line

Re: [cfe-users] Porting preprocessor macros to be compatible with clang

2019-08-21 Thread Matthew Fernandez via cfe-users
> On Aug 21, 2019, at 05:36, Forumer 4umer via cfe-users > wrote: > > So a bit more explanation, the macros are used to generate data structure and > methods and the following definition is used to declare a structure: > > DEF_STRUCT(namedDate, namedDate, (std::string

[cfe-users] clang-tblgen not installed

2019-09-05 Thread Alex Biddulph via cfe-users
Hi, Is there a reason why clang-tblgen is not installed with all of the other clang binaries? According to http://releases.llvm.org/8.0.0/docs/HowToCrossCompileLLVM.html clang-tblgen (along with llvm-tblgen) are needed if you want to cross-compile clang, but since clang-tblgen is not installe

[cfe-users] Debugging LLVM IR code

2019-09-06 Thread Ayush Mittal via cfe-users
Hello Clangers, I've a Instrumentation pass code which add some more checks (or statements) into the entry block (normal C functions). How could I debug it or add some debug statements in IR code to make sure if the control is flowing through that path or not. Thanks and Regards.

Re: [cfe-users] clang-tblgen not installed

2019-09-06 Thread Richard Smith via cfe-users
On Thu, 5 Sep 2019 at 20:19, Alex Biddulph via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > Is there a reason why clang-tblgen is not installed with all of the > other clang binaries? > > According to > http://releases.llvm.org/8.0.0/docs/HowToCrossCompileLLVM

[cfe-users] Why does clang not always produce constant value for same static constexpr

2019-09-25 Thread Christopher Williams via cfe-users
Given the code below, clang produces a constant value for test1, test2 and test4. Why doesn't it for test3? This is more of a curious query, than a request for help, but if someone does have the answer, I'd appreciate as much detail as possible. || |staticconstexprintcount_x(constchar*str){int

Re: [cfe-users] Why does clang not always produce constant value for same static constexpr

2019-09-25 Thread David Blaikie via cfe-users
now. - Dave On Wed, Sep 25, 2019 at 12:37 PM Christopher Williams via cfe-users < cfe-users@lists.llvm.org> wrote: > Given the code below, clang produces a constant value for test1, test2 > and test4. Why doesn't it for test3? > This is more of a curious query, than a request fo

Re: [cfe-users] Why does clang not always produce constant value for same static constexpr

2019-09-25 Thread Christopher Williams via cfe-users
a recipe for some problematic compile-time to me... but > don't know. > > - Dave > > On Wed, Sep 25, 2019 at 12:37 PM Christopher Williams via cfe-users > mailto:cfe-users@lists.llvm.org>> wrote: > > Given the code below, clang produces a constant value for test1, t

Re: [cfe-users] Why does clang not always produce constant value for same static constexpr

2019-09-25 Thread David Blaikie via cfe-users
ven when the language doesn't require it. Sounds like a > recipe for some problematic compile-time to me... but don't know. > > - Dave > > On Wed, Sep 25, 2019 at 12:37 PM Christopher Williams via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Given the cod

[cfe-users] Compiling CUDA does not define __CUDACC__

2019-10-02 Thread Edward Diener via cfe-users
According to https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code if I compile a CUDA file then __CUDACC__ should be defined. I have this program as 'clang_cuda.cu': #if !defined(__clang__) #error Clang is not defined #elif !defined(__CUDACC__) #error __CUDACC__

Re: [cfe-users] constexpr pointer-to-member-function broken in Clang 9?

2019-10-02 Thread Richard Smith via cfe-users
On Tue, 1 Oct 2019 at 10:42, Michael Price - Dev via cfe-users < cfe-users@lists.llvm.org> wrote: > Should this be ill-formed? > > struct C { > constexpr C() {} > constexpr bool f() const { return true; } > }; > constexpr C c{}; > > constexpr bool fail

Re: [cfe-users] PostgreSQL 12 build issues on Solaris 11.4

2019-10-07 Thread Jan Korous via cfe-users
+CC Kamil who might know the answer. Hi Eric, > On Oct 7, 2019, at 12:49 AM, Dechaux Eric CEN (BCQ STIG) via cfe-users > wrote: > > Hello, > > With the official llvm/clang release for Solaris 11.4 I tried to build > PostgreSQL 12 with JIT enabled. JIT uses LLVM. How

Re: [cfe-users] PostgreSQL 12 build issues on Solaris 11.4

2019-10-11 Thread Kamil Rytarowski via cfe-users
presume that getting pkgsrc and interacting with the Illumos community, in case of build issues, is the easiest approach. On 07.10.2019 20:01, Jan Korous wrote: > +CC Kamil who might know the answer. > > Hi Eric, > >> On Oct 7, 2019, at 12:49 AM, Dechaux Eric CEN (BCQ STIG) via cf

[cfe-users] libClang: BinaryOperator and UnaryOperator spelling.

2019-10-15 Thread Felipe Lotas via cfe-users
This message is a request to libClang developers. I'm not sure this is the right mailing list to ask. I'm using libClang API (simple C), not libTooling (C++). I'd like to get the cursor spelling of unary and binary operators correctly.Because clang_getCursorSpelling returns an empty string, I hav

[cfe-users] Why re-compile clang with clang?

2019-10-19 Thread Pratyush Das via cfe-users
Hi, I noticed here - https://clang.llvm.org/docs/LibASTMatchersTutorial.html#step-0-obtaining-clang that it is recommended to recompile clang after building it for the first time with itself. Why is that required? Thanks, -- Pratyush Das(Reik) ___ cfe

Re: [cfe-users] Why re-compile clang with clang?

2019-10-19 Thread David Blaikie via cfe-users
Not a requirement, but a suggestion - generally clang/llvm are optimized best with themselves. So it's generally considered the "optimal" setup. On Sat, Oct 19, 2019 at 10:48 AM Pratyush Das via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > I noticed here -

Re: [cfe-users] Why re-compile clang with clang?

2019-10-19 Thread Pratyush Das via cfe-users
Thanks! :) On Sat, 19 Oct 2019 at 23:20, David Blaikie wrote: > Not a requirement, but a suggestion - generally clang/llvm are optimized > best with themselves. So it's generally considered the "optimal" setup. > > On Sat, Oct 19, 2019 at 10:48 AM Pratyush Das

[cfe-users] create not a member of clang::ast_type_traits::

2019-10-20 Thread Ziemowit Laski via cfe-users
Hello, This question is a variant of http://lists.llvm.org/pipermail/cfe-dev/2016-June/049613.html. I'm also new to Clang/LLVM. I'm working with libtooling (I think) and am trying to use the ASTContext::getParents() function like so: const clang::Decl *decl = ...; aut

[cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
[Please cc me, as I am not on the list.] When compiling GMP 6.1.2 with MacPorts clang9 on MacOS 10.15, the check gives one error, but if turning on UBSan ‘undefined’, it passes without a report. Should it not report what it thinks is the issue? ___ c

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
You mentioned "the check gives one error" - which check? On Fri, Oct 25, 2019 at 8:21 AM Hans Åberg via cfe-users < cfe-users@lists.llvm.org> wrote: > [Please cc me, as I am not on the list.] > > When compiling GMP 6.1.2 with MacPorts clang9 on MacOS 10.15, the check

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
UBSan adds code to check things, it necessarily changes optimizations by having those checks in. It shouldn't affect the behavior of programs that don't exhibit UB (but I imagine it could affect the behavior of programs relying on specific IB (Implementation Defined Behavior)). Reducing a test ca

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
Hard to know what might be happening - what sort of failure you're seeing, etc. Perhaps UBSan is stabilizing/changing unspecified rather than undefined behavior - or the test is failing due to some undefined behavior that UBSan doesn't catch, etc. On Fri, Oct 25, 2019 at 11:25 AM Hans Åberg wrote

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
It's hard to know if it's the compiler's fault without a test case - due to the nature of undefined behavior and other things (implementation defined behavior and unspecified behavior) in C++, that the program behaves as expected with another compiler or another set of flags doesn't give a strong i

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
It's pretty hard to conclude whether it's a bug in your code or in the compiler, or both, without narrowing down a test case. On Fri, Oct 25, 2019 at 2:01 PM Hans Åberg wrote: > So then there probably is an issue with the optimization. > > Just run 'gmp-6.1.2’ with MacPorts clang 9.0.0; I got: >

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
Yeah, coming across compiler bugs does happen - but more often it's bugs in input programs. (one of the reasons compiler engineers aren't likely to jump on reproducing and reducing misbehaving programs, because on the odds, it's not a bug in the compiler) On Fri, Oct 25, 2019 at 3:12 PM Hans Åberg

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
UBSan doesn't catch everything - you could also try ASan and/or valgrind, etc. (MSan if you want, but that's a bit fussier/more work to use) On Fri, Oct 25, 2019 at 3:16 PM Hans Åberg wrote: > That is the reason I tried the UBSan, but as it changes optimization, it > does not wrok. > > > > On 26

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Matthew Fernandez via cfe-users
and results are included at https://gmplib.org/devel/tm/gmp/date.html <https://gmplib.org/devel/tm/gmp/date.html>. > On Oct 25, 2019, at 15:32, David Blaikie via cfe-users > wrote: > > UBSan doesn't catch everything - you could also try ASan and/or valgrind, > e

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
It is not my code, it belongs to gmp-6.1.2, I merely happened to come a cross it. It passes on gcc9, so there is something that clang9 does. > On 25 Oct 2019, at 23:15, David Blaikie wrote: > > It's pretty hard to conclude whether it's a bug in your code or in the > compiler, or both, without

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
The sources are available at [1]; it is written in C, not C++. I was was hoping that that something like UBSan would shed light on it, but the original question is answered: it changes optimization. The GMP developers say that they have caught some compiler bugs, but that is hard to do and time

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
The ‘make check’ of GMP 6.1.2. One of the tests fail, but with any UBSan ‘undefined’ option enabled (in ‘configure’), none. > On 25 Oct 2019, at 18:35, David Blaikie wrote: > > You mentioned "the check gives one error" - which check? ___ cfe-users ma

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
So then there probably is an issue with the optimization. Just run 'gmp-6.1.2’ with MacPorts clang 9.0.0; I got: ../../../gmp-6.1.2/test-driver: line 107: 70037 Abort trap: 6 "$@" > $log_file 2>&1 FAIL: t-sqrlo With Apple clang 11.0.0 (clang-1100.0.33.8), I got another ‘make check’ err

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
That is the reason I tried the UBSan, but as it changes optimization, it does not wrok. > On 26 Oct 2019, at 00:14, David Blaikie wrote: > > Yeah, coming across compiler bugs does happen - but more often it's bugs in > input programs. (one of the reasons compiler engineers aren't likely to ju

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
It is just an abort trap. The ‘make check' also passes if turning off optimization. I would have expected UBSan to not change anything in optimization, but merely report the issues it finds. Apparently it finds nothing, so it may suggest a compiler bug. > On 25 Oct 2019, at 22:34, David Blaiki

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread David Blaikie via cfe-users
ly tested with ubsan > and results are included at https://gmplib.org/devel/tm/gmp/date.html. > > On Oct 25, 2019, at 15:32, David Blaikie via cfe-users < > cfe-users@lists.llvm.org> wrote: > > UBSan doesn't catch everything - you could also try ASan and/or valgrind,

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-25 Thread Hans Åberg via cfe-users
The GMP developers felt it was a compiler bug, so I think I will leave it at that. But thanks for the tips. > On 26 Oct 2019, at 00:32, David Blaikie wrote: > > UBSan doesn't catch everything - you could also try ASan and/or valgrind, > etc. (MSan if you want, but that's a bit fussier/more wo

<    3   4   5   6   7   8   9   10   11   12   >