Re: [cfe-users] Mailman->Discourse Migration on February 1, 10am PST

2022-02-01 Thread Tanya Lattner via cfe-users
As a reminder, this will be happening this morning. Thanks, Tanya > On Jan 29, 2022, at 8:21 AM, Tanya Lattner wrote: > > LLVM Community, > > As referenced in this blog post > , we are getting > close to the deadline for migration

[cfe-users] Mailman->Discourse Migration on February 1, 10am PST

2022-01-29 Thread Tanya Lattner via cfe-users
LLVM Community, As referenced in this blog post , we are getting close to the deadline for migration for some Mailman lists to Discourse. If you are receiving this email from a LLVM Mailman list, then this list will be migrating to D

[cfe-users] clang-format: IndentBraces not acting as advertised?

2022-01-28 Thread Kasper Peeters via cfe-users
I am trying to use clang-format to indent braces as in void fun(...) { [...] [...] } which I know can be achieved with `BreakBeforeBraces: Whitesmiths`, but I want to customise some other settings. So I set `BreakBeforeBraces: Custom`, and then `IndentBraces: true` an

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-21 Thread via cfe-users
isn’t what was intended? -- John Dallman From: cfe-users mailto:cfe-users-boun...@lists.llvm.org>> On Behalf Of Tanya Lattner via cfe-users Sent: 12 January 2022 18:01 To: cfe-users@lists.llvm.org<mailto:cfe-users@lists.llvm.org> Subject: [cfe-users] cfe-users list moving to LLVM

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-20 Thread JVApen via cfe-users
Hey John I think you are confusing Discord and Discourse. Jeroen On Thu, Jan 20, 2022, 15:51 via cfe-users wrote: > This seems like a mistake. Discord is pretty good for tight communities > where everyone wants to know about everything that’s going on, and don’t > need to refer ba

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-20 Thread via cfe-users
: cfe-users On Behalf Of Tanya Lattner via cfe-users Sent: 12 January 2022 18:01 To: cfe-users@lists.llvm.org Subject: [cfe-users] cfe-users list moving to LLVM Discourse The cfe-users mailing list will be moved to LLVM Discourse under the “Using Clang” category (under Clang Frontend). All archives

Re: [cfe-users] Compile from source code string

2022-01-19 Thread 0dminnimda via cfe-users
Right now I'm in process of trying this approach: Copy the code from cc1_main, write my own SourceManager and set it to CompilerInstance with setSourceManager(). On Wed, Jan 19, 2022, 7:45 PM Matthew Fernandez wrote: > > > On Jan 17, 2022, at 21:59, 0dminnimda <0dminni...@gmail.com> wrote: > >

Re: [cfe-users] Compile from source code string

2022-01-19 Thread Matthew Fernandez via cfe-users
> On Jan 17, 2022, at 21:59, 0dminnimda <0dminni...@gmail.com> wrote: > > > The phrase “clang api” is a bit vague (libclang?) > > If it's possible, then of course LibClang as it's backward compatible, but I > know that it's restricted in functionality, so if LibClang don't give such > freedom,

[cfe-users] find external function from other module within module pass

2022-01-18 Thread Bella V via cfe-users
Hello, I have a module pass as well as a function pass which I'm invoking on shared library LLVM IR .so (which has multiple C source files). The library has linked external functions from another module (shared library), how do I identify those functions which are not defined in the current module.

Re: [cfe-users] Compile from source code string

2022-01-17 Thread 0dminnimda via cfe-users
l be bit more secure, I think. On Tue, Jan 18, 2022, 4:07 AM Matthew Fernandez wrote: > > > On Jan 17, 2022, at 14:35, 0dminnimda via cfe-users < > cfe-users@lists.llvm.org> wrote: > > > > I wanna use regular functionality of clang but instead of passing path > to

Re: [cfe-users] Compile from source code string

2022-01-17 Thread Matthew Fernandez via cfe-users
> On Jan 17, 2022, at 14:35, 0dminnimda via cfe-users > wrote: > > I wanna use regular functionality of clang but instead of passing path to the > source I want to pass string as source code. Yes, it's preferably a code that > uses clang api and not just call to cla

[cfe-users] Compile from source code string

2022-01-17 Thread 0dminnimda via cfe-users
I wanna use regular functionality of clang but instead of passing path to the source I want to pass string as source code. Yes, it's preferably a code that uses clang api and not just call to clang with source that was put into input, as source files are usually big. Googled that, but not really su

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-12 Thread Tanya Lattner via cfe-users
> On Jan 12, 2022, at 11:02 AM, Jeffrey Walton wrote: > > > > On Wed, Jan 12, 2022 at 1:00 PM Tanya Lattner via cfe-users > mailto:cfe-users@lists.llvm.org>> wrote: > The cfe-users mailing list will be moved to LLVM Discourse under the “Using > Clang” catego

Re: [cfe-users] cfe-users list moving to LLVM Discourse

2022-01-12 Thread Jeffrey Walton via cfe-users
On Wed, Jan 12, 2022 at 1:00 PM Tanya Lattner via cfe-users < cfe-users@lists.llvm.org> wrote: > The cfe-users mailing list will be moved to LLVM Discourse under the > “Using Clang” category (under Clang Frontend). All archives will be > migrated. *This list will be no longer be

[cfe-users] cfe-users list moving to LLVM Discourse

2022-01-12 Thread Tanya Lattner via cfe-users
The cfe-users mailing list will be moved to LLVM Discourse under the “Using Clang” category (under Clang Frontend). All archives will be migrated. This list will be no longer be in use starting February 1, 2022. Please see this blog post for all details: https://blog.llvm.org/posts/2022-01-07-m

Re: [cfe-users] cfe-users Digest, Vol 105, Issue 6

2022-01-08 Thread Robert Ankeney via cfe-users
I have run into this problem before. Instead of adding more RAM to my machine, I found that doing a "sudo make" will often succeed. Robert On Fri, Dec 24, 2021 at 8:09 AM via cfe-users wrote: > Send cfe-users mailing list submissions to > cfe-users@lists.llvm.org >

Re: [cfe-users] -Winvalid-noreturn warning

2022-01-06 Thread David Blaikie via cfe-users
91bx1 ) So far as I can tell, noreturn isn't carried on function types, so it isn't possible to do what you want at the moment. That's my rough understanding, at least. On Thu, Jan 6, 2022 at 5:23 PM Manu agarwal via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > &

[cfe-users] -Winvalid-noreturn warning

2022-01-06 Thread Manu agarwal via cfe-users
Hi, We have the below code where this warning gets generated. #include [[noreturn]] inline void abc () noexcept { std::terminate (); } using MyNoReturn = void (*) () noexcept; //using MyNoReturn = std::add_pointer_t;// even this declaration, instead of the above, gives the same wa

Re: [cfe-users] Issue with clang-13

2021-12-24 Thread Matthew Fernandez via cfe-users
> On Dec 24, 2021, at 09:56, Sunil Kumar wrote: > > Thanks Matthew. I am using the x86_64 system. > I wanted to ask you one more question. After installing clang, how to install > openmp with the OMPT tool interface in clang-13. Sorry, this is something I am not familiar with. I thought openm

Re: [cfe-users] Issue with clang-13

2021-12-24 Thread Sunil Kumar via cfe-users
21, at 06:45, Csaba Raduly via cfe-users < > cfe-users@lists.llvm.org> wrote: > > Hi Sunil, > > On Fri, 24 Dec 2021 at 14:51, Sunil Kumar via cfe-users > wrote: > > > Hi, > I tried many times to install clang-13 in ubuntu-16.04. I followed the > steps mentione

Re: [cfe-users] Issue with clang-13

2021-12-24 Thread Matthew Fernandez via cfe-users
> On Dec 24, 2021, at 06:45, Csaba Raduly via cfe-users > wrote: > > Hi Sunil, > > On Fri, 24 Dec 2021 at 14:51, Sunil Kumar via cfe-users > mailto:cfe-users@lists.llvm.org>> wrote: >> >> Hi, >> I tried many times to install clang-13 in ubuntu-16

Re: [cfe-users] Issue with clang-13

2021-12-24 Thread Csaba Raduly via cfe-users
Hi Sunil, On Fri, 24 Dec 2021 at 14:51, Sunil Kumar via cfe-users wrote: > > Hi, > I tried many times to install clang-13 in ubuntu-16.04. I followed the steps > mentioned below. > > git clone https://github.com/llvm/llvm-project.git > git checkout llvmorg-13.0.0 > cd ll

[cfe-users] Issue with clang-13

2021-12-24 Thread Sunil Kumar via cfe-users
Hi, I tried many times to install clang-13 in ubuntu-16.04. I followed the steps mentioned below. - git clone https://github.com/llvm/llvm-project.git - git checkout llvmorg-13.0.0 - cd llvm-project - mkdir build - cd build - cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles"

[cfe-users] EOF representation

2021-12-15 Thread Darren Parkinson via cfe-users
Hello,   I would like to know if the EOF representation has been disabled from not aborting the specific procedure to being enabled to abort the program abruptly. If not, how would you end a specific procedure (such as when reading characters from the console) without aborting the entire program?

[cfe-users] read an external file in a function/module pass

2021-12-06 Thread Bella V via cfe-users
Hello All, I have a custom function & module pass. I'm invoking these passes using OPT. I would like to read an external YAML file inside the pass. I could pass the file as a command-line argument to the OPT, I could not find the options available. Are there any options or is there another way

Re: [cfe-users] (bug?) ParsedAttr::getNumArgs() always return zero

2021-12-06 Thread Владимир Фролов via cfe-users
Reference.html )I think this is https://bugs.llvm.org/show_bug.cgi?id=46446, which hasmore details about the issues and plausible ways forward.~Aaron  On Thu, Dec 2, 2021 at 5:23 AM Владимир Фролов via cfe-users <cfe-users@lists.llvm.org> wrote: Dear colleguaes, it seems i have met the bug fo

[cfe-users] bug? pragma section and optimization, initialized static variable

2021-12-05 Thread Helmut via cfe-users
Hello, I'm compiling for arm with and without optimization and get different sections for the initialized static variable myvar. Unexpected section (wrong): clang -std=c99 --target=thumbv7em-unknown-none-eabihf -g3 -O1 -gdwarf-2 -gstrict-dwarf -fdebug-macro -c main.c llvm-objdump.exe .

Re: [cfe-users] (bug?) ParsedAttr::getNumArgs() always return zero

2021-12-02 Thread Aaron Ballman via cfe-users
number of attributes for > any clang-supported attribute (listed here: > https://clang.llvm.org/docs/AttributeReference.html ) I think this is https://bugs.llvm.org/show_bug.cgi?id=46446, which has more details about the issues and plausible ways forward. ~Aaron > > On Thu, Dec 2, 2

Re: [cfe-users] (bug?) ParsedAttr::getNumArgs() always return zero

2021-12-02 Thread David Blaikie via cfe-users
/clang.llvm.org/docs/AttributeReference.html ) On Thu, Dec 2, 2021 at 5:23 AM Владимир Фролов via cfe-users < cfe-users@lists.llvm.org> wrote: > Dear colleguaes, it seems i have met the bug for processing of C++11 > custom language attributes. > > 1) I took example from > https

[cfe-users] (bug?) ParsedAttr::getNumArgs() always return zero

2021-12-02 Thread Владимир Фролов via cfe-users
Dear colleguaes, it seems i have met the bug for processing of C++11 custom language attributes. 1) I took example from https://github.com/llvm/llvm-project/blob/main/clang/examples/Attribute/Attribute.cpp2) And make a short sample which reproduce the bug https://github.com/FROL256/clang_parse_ast_

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread Jeffrey Walton via cfe-users
On Thu, Sep 23, 2021 at 12:48 PM David Blaikie via cfe-users wrote: > > On Thu, Sep 23, 2021 at 3:34 AM John Emmas via cfe-users > wrote: >> ... >> Over on llvm-dev I'm trying to persuade them that declaring something as >> __declspec(dllimport) should aut

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread John Emmas via cfe-users
Many thanks Dave, Over on llvm-dev a contributer called Hans found this on Microsoft's MSDN site:- https://docs.microsoft.com/en-us/cpp/cpp/defining-inline-cpp-functions-with-dllexport-and-dllimport So the current theory is that Microsoft's compiler can indeed inline DLL functions - but p

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread David Blaikie via cfe-users
On Thu, Sep 23, 2021 at 3:34 AM John Emmas via cfe-users < cfe-users@lists.llvm.org> wrote: > On 22/09/2021 18:21, Reid Kleckner via cfe-users wrote: > > Looking back in the thread, I found the example code, and I see that > > MSVC refuses to inline this helper, but cl

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread John Emmas via cfe-users
On 22/09/2021 18:21, Reid Kleckner via cfe-users wrote: Looking back in the thread, I found the example code, and I see that MSVC refuses to inline this helper, but clang will inline it. I believe clang is permitted to inline it, MSVC will export the static data member (_the_keyboard), so

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread Reid Kleckner via cfe-users
er heuristics in MSVC and clang. If you provide and export a definition of this static global, things should link as expected. On Wed, Sep 22, 2021 at 9:50 AM David Blaikie wrote: > Probably Reid and Hans are folks to start with for Windows support > > On Wed, Sep 22, 2021 at 4:38 A

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread David Blaikie via cfe-users
Probably Reid and Hans are folks to start with for Windows support On Wed, Sep 22, 2021 at 4:38 AM Jeffrey Walton via cfe-users < cfe-users@lists.llvm.org> wrote: > On Wed, Sep 22, 2021 at 7:21 AM John Emmas via cfe-users > wrote: > > > > On 21/09/2021 14:24, John E

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread Jeffrey Walton via cfe-users
On Wed, Sep 22, 2021 at 7:21 AM John Emmas via cfe-users wrote: > > On 21/09/2021 14:24, John Emmas via cfe-users wrote: > > > > clang-cl /? reveals that it'll handle the Microsoft variant of /Ob0 > > ... > All the signs here are that Clang is still trying to inli

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread John Emmas via cfe-users
On 21/09/2021 14:24, John Emmas via cfe-users wrote: clang-cl /? reveals that it'll handle the Microsoft variant of /Ob0 [...] So do you happen to know if clang-cl produces some kinda log file (i.e. that'd let me see which commands it actually received?) All the signs here are

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
I just found something else which might be significant... I noticed that when linking this exe, I had a linker option enabled called /FORCE:MULTIPLE If I remove that option, the Clang linker then gives me a list of about a dozen duplicated symbols. And with that option I get a similarly siz

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
On 21/09/2021 13:49, Jeffrey Walton wrote: The U&L option is -fno-inline. But I think Clang has an option to consume MSVC style options, so you may be able to use /Ob. I think you can check which MSVC style options Clang accepts with 'clang-cl /?' or 'clang-cl -?'. Thanks again Jeff and you'

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread Jeffrey Walton via cfe-users
> ... > I checked this morning and sure enough the "/Ob" option doesn't get sent > if I build with VS2019 and Clang - so I'm guessing "/Ob0" wouldn't be > recognised by Clang's compiler? > > So does Clang have it's own command-line option to disable inline > function expansion? Or is that somethi

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
Many thanks Jeff & David, Overnight I remembered that Visual Studio itself offers a specific option to disable inline function expansion. For MSVC itself, this gets done by setting a compiler option called "/Ob" ("/Ob0" indicates disabled). If "/Ob0" isn't specified at compile time, inlining

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread Jeffrey Walton via cfe-users
On Mon, Sep 20, 2021 at 7:37 AM John Emmas via cfe-users wrote: > > Hi there - I'm building quite a complex Windows program here using > VS2019. Obviously there's an EXE and there's maybe 30 or so DLLs. Some > DLL's might have code which looks like this in a heade

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread David Blaikie via cfe-users
I'm not sure it's the right/necessary solution, but one way would be to move the function definition (for the_keyboard) out of line (define it in some .cpp/.cc/whatever file, not in the header) - if you don't want it to be inlined. On Mon, Sep 20, 2021 at 6:56 AM John Emmas via

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread John Emmas via cfe-users
On 20/09/2021 12:36, John Emmas via cfe-users wrote: But if I switch VS2019 to use Clang (when building the EXE) Clang's linker will complain that it can't find the variable 'revision_num'. But of course, 'revision_num' is an internal variable that's priv

[cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread John Emmas via cfe-users
Hi there - I'm building quite a complex Windows program here using VS2019. Obviously there's an EXE and there's maybe 30 or so DLLs. Some DLL's might have code which looks like this in a header file:- class whatever { static int revision_num; }; or if there's no class involved

Re: [cfe-users] need help with clang

2021-09-19 Thread Jeffrey Walton via cfe-users
On Mon, Sep 20, 2021 at 1:26 AM Pi Pony via cfe-users wrote: > ... > It's so I can learn to use LLVM and Clang better and contribute to the > community, please pass the knowledge further. > > for ( struct { int i; char* ptr; } loopy = { 0, "LLVM" }; > >

[cfe-users] need help with clang

2021-09-19 Thread Pi Pony via cfe-users
Hello to all, WARNING: IF YOU ARE PROFESSIONAL PROGRAMMER PLEASE DONT READ THIS IT MAY BURN YOUR EYES i tried to compile a code that isn't compatible with clang, I want to know how to make it work and if not how to add a feature so that it will work? It's so I can learn to use LLVM and Clang bet

Re: [cfe-users] [cfe-dev] Removing or obfuscating RTTI type name strings

2021-09-03 Thread David Blaikie via cfe-users
On Fri, Sep 3, 2021 at 2:55 PM Richard Smith via cfe-dev < cfe-...@lists.llvm.org> wrote: > On Fri, 27 Aug 2021 at 11:03, Andy Gibbs via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hi there, >> >> I'm hitting a rather difficult problem. I

Re: [cfe-users] Removing or obfuscating RTTI type name strings

2021-09-03 Thread Richard Smith via cfe-users
On Fri, 27 Aug 2021 at 11:03, Andy Gibbs via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi there, > > I'm hitting a rather difficult problem. I have to compile with RTTI data > structures generated because, even though I am not using dynamic_cast or > typeid in

[cfe-users] Removing or obfuscating RTTI type name strings

2021-08-27 Thread Andy Gibbs via cfe-users
Hi there, I'm hitting a rather difficult problem. I have to compile with RTTI data structures generated because, even though I am not using dynamic_cast or typeid in my application code, I am linking and using a library that does use dynamic_cast. Therefore my code will crash if I compile wit

Re: [cfe-users] Matcher for templated variable

2021-08-17 Thread Jonas Toth via cfe-users
s Am 09.08.21 um 00:37 schrieb Robert Ankeney via cfe-users: > I'm looking to create AST matchers for variables that are templated. > For example, in the code: > > template class Class  // template <(class or typename or > int/float/etc) T> > { > public: > >

[cfe-users] Matcher for templated variable

2021-08-08 Thread Robert Ankeney via cfe-users
I'm looking to create AST matchers for variables that are templated. For example, in the code: template class Class // template <(class or typename or int/float/etc) T> { public: void Func(T* Param)// 1) match Param { Param = nullptr; // 2) match Param } T* Var =

[cfe-users] visit all constantExpr directly for a Function/Module Pass

2021-07-29 Thread Bella V via cfe-users
Hello All, Is there a way to get all constantExpr as a batch similar to InstVisitor, which has a visitor for each type of instruction. https://llvm.org/doxygen/classllvm_1_1InstVisitor.html Regards. ___ cfe-users mailing list cfe-users@lists.llvm.org h

Re: [cfe-users] detect default in SwitchInst

2021-07-16 Thread David Blaikie via cfe-users
lt: >> https://llvm.org/docs/LangRef.html#switch-instruction - that jumps over >> the body of the switch. (when lowering C code to LLVM IR the default would >> be put after the loop, and the breaks from any case statements would jump >> over that default block) >> >&

Re: [cfe-users] detect default in SwitchInst

2021-07-16 Thread Bella V via cfe-users
e statements would jump > over that default block) > > On Fri, Jul 16, 2021 at 12:34 PM Bella V via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hello All, >> >> >> >> I'm trying to find whether SwitchInst has a default statement.

Re: [cfe-users] detect default in SwitchInst

2021-07-16 Thread David Blaikie via cfe-users
) On Fri, Jul 16, 2021 at 12:34 PM Bella V via cfe-users < cfe-users@lists.llvm.org> wrote: > Hello All, > > > > I'm trying to find whether SwitchInst has a default statement. I'm able to > iterate through the case values using case_begin and case_end. If I try to &

[cfe-users] detect default in SwitchInst

2021-07-16 Thread Bella V via cfe-users
Hello All, I'm trying to find whether SwitchInst has a default statement. I'm able to iterate through the case values using case_begin and case_end. If I try to detect default using case_default which returns an iterator which points to the default case. Code Example: case_default()->getCaseIn

Re: [cfe-users] No macros in DI metadata

2021-07-14 Thread David Blaikie via cfe-users
nit->getMacros(); >> > for (auto *MN : Macros) { >> > if (auto *M = dyn_cast(MN)) { >> > outs()<< M->getName(); >> > } >> > } >> > >> > >> > On Tue, Jul 13, 2021 at 4:13 PM David Blaikie wrote: >&g

Re: [cfe-users] No macros in DI metadata

2021-07-14 Thread Bella V via cfe-users
for (auto *MN : Macros) { > > if (auto *M = dyn_cast(MN)) { > > outs()<< M->getName(); > > } > > } > > > > > > On Tue, Jul 13, 2021 at 4:13 PM David Blaikie > wrote: > >> > >> Add -fdebug-macro > >> > >> O

Re: [cfe-users] No macros in DI metadata

2021-07-13 Thread David Blaikie via cfe-users
t;getMacros(); > for (auto *MN : Macros) { > if (auto *M = dyn_cast(MN)) { > outs()<< M->getName(); > } > } > > > On Tue, Jul 13, 2021 at 4:13 PM David Blaikie wrote: >> >> Add -fdebug-macro >> >> On Tue, Jul 13, 2021 at 4:05

Re: [cfe-users] No macros in DI metadata

2021-07-13 Thread Bella V via cfe-users
ast(MN)) { outs()<< M->getName(); } } On Tue, Jul 13, 2021 at 4:13 PM David Blaikie wrote: > Add -fdebug-macro > > On Tue, Jul 13, 2021 at 4:05 PM Bella V via cfe-users > wrote: > > > > Hello All, > > > > I'm trying to build a list

Re: [cfe-users] No macros in DI metadata

2021-07-13 Thread David Blaikie via cfe-users
Add -fdebug-macro On Tue, Jul 13, 2021 at 4:05 PM Bella V via cfe-users wrote: > > Hello All, > > I'm trying to build a list of macros in a compilation unit using > CU->getMacros(). > I do not see the macros field in DICompileUnit output. > https://godbolt.org/z/b8c

[cfe-users] No macros in DI metadata

2021-07-13 Thread Bella V via cfe-users
Hello All, I'm trying to build a list of macros in a compilation unit using CU-> getMacros (). I do not see the macros field in DICompileUnit output. *https://godbolt.org/z/b8cM1Yf7v

Re: [cfe-users] cfe-users Digest, Vol 102, Issue 1

2021-07-11 Thread Crystallstarr Plumb via cfe-users
even about I appreciate any time and energy you can afford at your earliest convenience to help me with in this matter and would like to thank you for any light you can help me shed on the matter , Crystall Starr Watch out get some > On Jul 10, 2021, at 2:00 PM, via cfe-users wrote: > &

Re: [cfe-users] clang-format feature request

2021-07-09 Thread Richard via cfe-users
[Please reply *only* to the list and do not include my email directly in the To: or Cc: of your reply; otherwise I will not see your reply. Thanks.] In article , Robert Ankeney via cfe-users writes: > Any hope this request can make it to the appropriate ears? You can log feature reque

[cfe-users] clang-format feature request

2021-06-29 Thread Robert Ankeney via cfe-users
I'm not sure where best to post this, but I'd like to see a couple of features added to clang-format, and from browsing around, have seen others looking for these features, too. 1) Ability to break declaration parameters into groups when more than N parameters are declared. For example, if I have m

[cfe-users] getelementptr global type query

2021-05-26 Thread Bella V via cfe-users
Hello All, I'm not able to extract f1 from a getelementptr inbounds Instruction. struct foo { int num; }; extern struct foo f1; void hello () { if (f1.num){ } } @f1 = external dso_local global %struct.foo, align 4 define dso_local void @hello() #0 !dbg !9 { %1 = load i32, i32* getelementptr inbou

Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-25 Thread David Blaikie via cfe-users
t; >> You'd have to analyze the dbg.declares and track that they refer to the >> same thing as the geps/loads you're interested in - from the dbg.declares >> (& dbg.values) you can follow those to find the variables they refer to. >> >> On Thu, May

Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-25 Thread Bella V via cfe-users
s) you can follow those to find the variables they refer to. > > On Thu, May 20, 2021 at 12:18 PM Bella V via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hello All, >> >> I read the documentation and I was able to fetch the variable names and >

Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-20 Thread David Blaikie via cfe-users
You'd have to analyze the dbg.declares and track that they refer to the same thing as the geps/loads you're interested in - from the dbg.declares (& dbg.values) you can follow those to find the variables they refer to. On Thu, May 20, 2021 at 12:18 PM Bella V via cfe-use

[cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-20 Thread Bella V via cfe-users
Hello All, I read the documentation and I was able to fetch the variable names and source locations attached to metadata for call instructions (@llvm.dbg.declare) using dyn_cast. I wanted to check if we could fetch the variable names in the load/gep instructors using debugInfo. I want to collect t

[cfe-users] Issue when clang launches "ld.lld.exe" in Windows OS through "-fuse-ld=ld.lld"

2021-05-11 Thread Ni, Ray via cfe-users
Dear clang experts, I want to build out ELF image using clang in Windows OS. But I met an issue when using "-fuse-ld=ld.lld" to ask clang launch ld.lld.exe as a linker. Somehow clang always passes additional parameter to ld.lld: "-libpath:E:\\bin\\LLVM\\lib\\clang\\12.0.0\\lib\\windows" -nologo I

[cfe-users] Shared Debug Build MSYS2 MinGW-w64 constant Link Error

2021-05-11 Thread Oliver Niebuhr via cfe-users
Hello. As Static Debug Builds only work with MSVC, I am forced to use Shared-Libs with GCC on MSYS2. The Problem is, it always Fails at this exact stage: FAILED: bin/BugpointPasses.dll cmd.exe /C "cd . && C:\Dev\msys64\mingw64\bin\g++.exe -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-un

Re: [cfe-users] How to find the physical end of an expression?

2021-05-05 Thread Richard Smith via cfe-users
On Wed, 28 Apr 2021 at 13:53, Taylor, Max via cfe-users < cfe-users@lists.llvm.org> wrote: > Greetings. > > > > I’m building a source-to-source tool with clang. What I want to do is > instrument stores made with the binary = operator. Currently, I’m running > i

[cfe-users] How to find the physical end of an expression?

2021-04-28 Thread Taylor, Max via cfe-users
Greetings. I’m building a source-to-source tool with clang. What I want to do is instrument stores made with the binary = operator. Currently, I’m running into problems with rewriting expressions that contain macro invocations. I’ve done some digging around, and I found some info that helped w

[cfe-users] Bug? -fno-plt has no effect

2021-04-14 Thread Mitch Lindgren via cfe-users
Hi, I'm developing a shared object module for which I need to ensure there is not PLT section. Some background on why I have this requirement is available in this Stack Overflow question. In gcc, I can a

Re: [cfe-users] [llvm-dev] Fine Grained Optimization Control

2021-03-28 Thread Navid Rahimi via cfe-users
Makes sense thank you. I have to look at the dependencies between different optimization passes too I guess. On Sun, Mar 28, 2021 at 17:33 Johannes Doerfert wrote: > I recommend adding such a flag to the pass you want to disable. > Whenever `runOnXXX` is called, check the flag and exit if set. >

Re: [cfe-users] [llvm-dev] Fine Grained Optimization Control

2021-03-28 Thread Johannes Doerfert via cfe-users
I recommend adding such a flag to the pass you want to disable. Whenever `runOnXXX` is called, check the flag and exit if set. ~ Johannes On 3/28/21 5:27 PM, Navid Rahimi wrote: Thanks Johannes. That makes this makes it more understandable to me. What can I do for optimization that doesn’t hav

Re: [cfe-users] [llvm-dev] Fine Grained Optimization Control

2021-03-28 Thread Navid Rahimi via cfe-users
Thanks Johannes. That makes this makes it more understandable to me. What can I do for optimization that doesn’t have flag? How should I approach disabling them. On Sat, Mar 27, 2021 at 22:10 Johannes Doerfert wrote: > Hi Navid, > > comments inlined. > > On 3/27/21 9:24 PM, Navid Rahimi via llvm

Re: [cfe-users] [llvm-dev] Fine Grained Optimization Control

2021-03-28 Thread Johannes Doerfert via cfe-users
Hi Navid, comments inlined. On 3/27/21 9:24 PM, Navid Rahimi via llvm-dev wrote: Hi everyone, tl;dr: I want to control which optimization and transformation can and will run on my code. Does Clang/LLVM permit such an approach? There is no unified approach to this as far as I know. The closes

[cfe-users] Fine Grained Optimization Control

2021-03-27 Thread Navid Rahimi via cfe-users
Hi everyone, tl;dr: I want to control which optimization and transformation can and will run on my code. Does Clang/LLVM permit such an approach? I am doing this with GCC. But at first, it seems for some reason GCC does not allow optimizations to run unless I am passing -Ox flag (x>=1). The appro

Re: [cfe-users] Some basic AST file generation questions

2021-03-26 Thread Nigel Perks via cfe-users
For (1) on my Linux clang -cc1 -help shows options of the compiler proper including ast-dump but I didn't get syntax-only. Nigel From: cfe-users On Behalf Of Ray Mitchell via cfe-users Sent: 26 March 2021 00:25 To: cfe-users@lists.llvm.org Subject: [cfe-users] Some basic AST file gener

[cfe-users] Some basic AST file generation questions

2021-03-25 Thread Ray Mitchell via cfe-users
Win10-64, clang v11.0.0, VS2019 When I enter "clang.exe -help" from the command line I get a long list of clang options, and one of them is "-Xclang ". Thanks to previous help from a member of the cfe-users digest, I am able to do "clang.exe -Xclang -ast-dump -fsyntax-only SourceFile.c" to get

Re: [cfe-users] Locally built clang on macOS 10.15.7

2021-03-16 Thread Matthew Fernandez via cfe-users
> On Mar 11, 2021, at 02:27, Mark Jamsek via cfe-users > wrote: > > I checked out and built clang as per the docs Getting Started page[0]. > > When using clang, however, compilation of C and C++ projects fail to > find the needed headers from their respective standard

Re: [cfe-users] Locally built clang on macOS 10.15.7

2021-03-16 Thread Sean McBride via cfe-users
On Thu, 11 Mar 2021 21:27:27 +1100, Mark Jamsek via cfe-users said: >I checked out and built clang as per the docs Getting Started page[0]. Those instructions haven't worked on macOS since at least autumn 2019. >When using clang, however, compilation of C and C++ projects fail t

[cfe-users] Locally built clang on macOS 10.15.7

2021-03-16 Thread Mark Jamsek via cfe-users
I checked out and built clang as per the docs Getting Started page[0]. When using clang, however, compilation of C and C++ projects fail to find the needed headers from their respective standard libraries. I can get around this in C projects by setting the environment variable SDKROOT[1], and for

[cfe-users] IMPORTANT NOTICE - Subscription to Mailman lists disabled immediately

2021-03-05 Thread Tanya Lattner via cfe-users
All, We need to immediately disable subscription capabilities to all LLVM Mailman lists. The current Mailman server is being abused by subscribing valid email addresses to our lists and because the list requires confirmation, the email address gets “spam”. An email address is subscribed upward

[cfe-users] Retrieve value from DeclExprRef

2021-03-03 Thread Marcos Horro Varela via cfe-users
Hello all, Having a loop like this: . |-DeclStmt 0x233fe40 | `-VarDecl 0x233fdb8 col:9 used I 'int' cinit | `-IntegerLiteral 0x233fe20 'int' 0 . `-ForStmt 0x236b390 |-DeclStmt 0x2340710 | `-VarDecl 0x2340670 col:14 used i 'int' cinit | `-I

[cfe-users] Generation of FMA instructions in RISCV

2021-03-02 Thread Max Ruttenberg via cfe-users
Hi all, I am using the clang RISCV backend and I am having trouble getting the compiler to generate FMA instructions with the following input. float test (float first, float second, float third) { return first * second + third; } I am using -O3 and -ffast-math and I am specifying -march

[cfe-users] lto support for ARM?

2021-02-25 Thread Ralph Doncaster via cfe-users
I tried clang-11 + lld-11 from apt.llvm.org on Debian 10, and when I try to use lto with arm targets like armv6m-none-eabi I get an error message: "unable to pass LLVM bit-code files to linker" I tried a clang-11 mingw build (from https://github.com/mstorsjo/llvm-mingw) and get the same error mess

[cfe-users] How to get llvm Location of Used Variables

2021-02-23 Thread Bella V via cfe-users
Hello LLVM Experts, Please ignore the last email. I'm trying to get the location of used variables inside the function pass. For example: *Symbol a = [4, 4, 6] linesSymbol b= [5, 5, 7] lines* *C code:* void bar() { int a = 10; //line 2 int b = 20; //line 3 a = a + 5;//line 4

[cfe-users] How to get llvm Location of Used Variables

2021-02-23 Thread Bella V via cfe-users
Hello Experts, I'm trying to get the location of used variables inside the function pass. For example the output should be: variable name = [line numbers where they are used] Output: a = [5,7] b= [6,8] C code void bar() { int a = 10; //line 2 int b = 20; //line 3 a = a +

Re: [cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-02-18 Thread David Blaikie via cfe-users
gt; > *Subject:* Re: [cfe-users] Clang Sizeof give diff value for Microsoft and > Linux > > > > Clang on Windows is designed to be compatible with MSVC - which has > different layout requirements than the Itanium ABI/GCC on Linux. I don't > think there's a way to use the s

Re: [cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-02-18 Thread Vivek Pandey via cfe-users
requirements than the Itanium ABI/GCC on Linux. I don't think there's a way to use the same ABI on both platforms - especially not if you are interacting with any code compiled by another compiler on both platforms (existing/foregin C++ precompiled libraries). On Thu, Jan 28, 2021

Re: [cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-02-17 Thread Vivek Pandey via cfe-users
especially not if you are interacting with any code compiled by another compiler on both platforms (existing/foregin C++ precompiled libraries). On Thu, Jan 28, 2021 at 1:45 PM Vivek Pandey via cfe-users mailto:cfe-users@lists.llvm.org>> wrote: Hi Team, We are using Clang 11 for our product

Re: [cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-02-17 Thread David Blaikie via cfe-users
requirements than the Itanium ABI/GCC on Linux. I don't > think there's a way to use the same ABI on both platforms - especially not > if you are interacting with any code compiled by another compiler on both > platforms (existing/foregin C++ precompiled libraries). > > > >

[cfe-users] prevent double rewriting

2021-02-03 Thread Владимир Фролов via cfe-users
Dear clang developers, greetings!I would like to ask what is the best way to prevent double rewriting of the code; Please consider further example: m_foundPixels.resize(0); Where m_foundPixels is class member of "RedPixels" class; Here is the AST dump for it: CXXMemberCallExpr 0x57a11e40 'void'

Re: [cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-01-28 Thread David Blaikie via cfe-users
er on both platforms (existing/foregin C++ precompiled libraries). On Thu, Jan 28, 2021 at 1:45 PM Vivek Pandey via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi Team, > > > > We are using Clang 11 for our product that has common C++ code base for > Windows, Linux, Macintosh,

[cfe-users] Clang Sizeof give diff value for Microsoft and Linux

2021-01-28 Thread Vivek Pandey via cfe-users
Hi Team, We are using Clang 11 for our product that has common C++ code base for Windows, Linux, Macintosh, …. We observed that sizeof operator gives different value on Windows and Linux/OSX, when the inheritance is from a common base class: Example Sample: #include struct Base {}; // empty

  1   2   3   4   5   6   7   8   9   10   >