Re: [cfe-users] Building with Clang (on Windows) - but for Linux

2020-08-26 Thread John Emmas via cfe-users
Many thanks guys !! ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-29 Thread Manu agarwal via cfe-users
Fri, 21 Aug 2020 at 13:29, Manu agarwal via cfe-users mailto:cfe-users@lists.llvm.org>> wrote: Hello, In the below code the compiler throws "undeclared identifier" when the commented line is uncommented. Whereas the line just before compiles fine. Regards, Manu typedef b

Re: [cfe-users] Compiling on network share using relative paths fails

2020-09-10 Thread David Blaikie via cfe-users
Can you confirm other tools given similar path specifications in similar circumstances (command line/current working directory/etc) succeed where clang fails? (MSVC, notepad, gcc, 'cat' (if Windows has a 'cat')) On Wed, Sep 9, 2020 at 10:41 AM Telium Technical Support via c

Re: [cfe-users] Compiling on network share using relative paths fails

2020-09-10 Thread Jan Korous via cfe-users
r-and-logviewer Jan > On Sep 10, 2020, at 11:17 AM, Telium Technical Support via cfe-users > wrote: > > Yes – I can open the file using relative path (in notepad) or type (cat) the > file from the command line. Only clang++ seems to have a problem. > > From: David Blaikie

[cfe-users] Is there a command line switch comparable to gcc's -fcx-limited-range ?

2020-09-30 Thread Christian Buchner via cfe-users
Hi, we have a fairly large code base that spends significant time in library routines like __mulsc3 and __muldc3 which are called whenever complex float or double types are multiplied. To improve this situation for people who want to trade speed for C99 compliance of complex multiplications, the

Re: [cfe-users] Adding linker flag `-save-temps` resolves the clang-8 error: "unable to make temporary file"

2020-10-05 Thread Danijel DOMAZET via cfe-users
lve my problem? Danijel On Thu, Aug 13, 2020 at 8:27 PM David Blaikie wrote: > Oh, sorry, I didn't read the question in detail about how -save-temps > was making things work when they otherwise were not. > > If you run clang with -### it'll show the command lines it's u

Re: [cfe-users] Adding linker flag `-save-temps` resolves the clang-8 error: "unable to make temporary file"

2020-10-05 Thread David Blaikie via cfe-users
r/lib/gcc/x86_64-pc-cygwin/10/crtend.o" > > So, again "my_files\\my_file1.o" "my_files\\my_file2.o" " > my_files\\my_file3.o" is lost and substituted with empty strings "" "" "" > . > > > Does this info help resol

[cfe-users] Puzzling vector optimisation inconsistency

2020-10-12 Thread Chris Webb via cfe-users
I've been investigating performance inconsistencies of some vector code when compiled with clang. Trying to boil it down to a minimal example, I'm puzzled by the following: #include #include #include #include typedef uint32_t uint32x4_t __attribute__((vector_size(16))); static

[cfe-users] On the effect of #pragma STDC CX_LIMITED_RANGE ON

2020-10-15 Thread Christian Buchner via cfe-users
Hi. I am finding that using said pragma does not have the intended effect of disabling the C99 Annex G compliance that generates calls into the rather slow __mulsc3 and __muldc3 soft float library functions. This behavior was observed in Clang 11 and 10 (I did not test older revisions). Allow me

[cfe-users] Float.h file not found error

2020-10-22 Thread Aditya Panigrahi via cfe-users
Hello Harry, I am facing the same issue you described in mail-archive. I didn't get any fix for this yet. Please contact me back in this id or through WhatsApp (+919353165134), if you have any fix. That would be a great help. Regards, Aditya Panigrahi _

[cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread Pavel Černohorský via cfe-users
Hello, I would like to ask what is wrong with the following code: ``` #include struct S {    S& operator=(S&) { return *this; }; }; void thisWillNotCompileInClang() {   std::optional a; } ``` Compilation command is `g++ or clang++ -std=c++17 -c source.cpp`. It compiles without problems wit

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread Marshall Clow via cfe-users
> On Nov 5, 2020, at 6:34 AM, Pavel Černohorský via cfe-users > wrote: > > Hello, > > I would like to ask what is wrong with the following code: > ``` > > #include > > struct S > { > S& operator=(S&) { return *this; }; > }; > >

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread Pavel Černohorský via cfe-users
On 05. 11. 20 15:47, Marshall Clow via cfe-users wrote: I tried this code on compiler explorer. It compiles w/o error with clang + libc++ It fails to compile with clang and libstdc++ The error message given is: In file included from :1: /opt/compiler-explorer/gcc-10.2.0/lib/gcc/x86_64-linux

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread connor horman via cfe-users
t; > I presume it's the same or similar in both C++17 and C++20 (published) > (with Cpp17Destructible being just Destructible in C++17). > > > On Thu, Nov 5, 2020 at 10:07 Pavel Černohorský via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> On 05. 11. 20

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread connor horman via cfe-users
ame or similar in both C++17 and C++20 (published) >> (with Cpp17Destructible being just Destructible in C++17). >> >> >> On Thu, Nov 5, 2020 at 10:07 Pavel Černohorský via cfe-users < >> cfe-users@lists.llvm.org> wrote: >> >>> On 05. 11. 20 15:47, Ma

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-05 Thread Marshall Clow via cfe-users
On Nov 5, 2020, at 6:34 AM, Pavel Černohorský via cfe-users wrote: > > Hello, > > I would like to ask what is wrong with the following code: > ``` > > #include > > struct S > { >S& operator=(S&) { return *this; }; > }; > > void t

[cfe-users] How to make #error or #warning work with libclang preprocessing?

2020-11-06 Thread Larry Gritz via cfe-users
I'm using clang libraries to implement the preprocessor for my language -- set up a CompilerInstance, setDiagnostics, ... DoPrintPreprocessedInput. When I preprocess code that has a #error or #warning, it just gets reported as "invalid preprocessing directive" on the clang side, no different tha

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-09 Thread Richard Smith via cfe-users
On Thu, 5 Nov 2020 at 09:29, Marshall Clow via cfe-users < cfe-users@lists.llvm.org> wrote: > On Nov 5, 2020, at 6:34 AM, Pavel Černohorský via cfe-users < > cfe-users@lists.llvm.org> wrote: > > > > Hello, > > > > I would like to ask what is wrong with th

Re: [cfe-users] Code which compiles with g++ but not with clang++

2020-11-09 Thread Pavel Černohorský via cfe-users
On 09. 11. 20 9:28, Richard Smith wrote: Right, this was made valid by P0641R2, which was voted into C++20 but was not moved as a defect report resolution against prior standards. So I think g++ is being more permissive than the standard requires (though as far as I can see, it would be a con

[cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread Sven Köhler via cfe-users
Hi, consider the following code: uint16_t testa4(uint8_t x, uint8_t y) { return ( (uint16_t)x << 0 ) | ( (uint16_t)y << 8 ); } uint16_t testb3(uint16_t x, uint16_t y) { return x|y; } uint16_t testb4(uint16_t x, uint16_t y) { return x+y; } int testb4x(uint16_t x, uint16_t y

Re: [cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread Sven Köhler via cfe-users
Hi, > even though the two operands of the bitwise-or are both uint16_t. That's not true. I had many more versions of the test code before I posted here and I got confused. In testa4, the operands of the bitwise-or are both ints due to the bitshift which performs and integer promotion. Kind Rega

Re: [cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread David Blaikie via cfe-users
On Mon, Nov 16, 2020 at 12:36 PM Sven Köhler via cfe-users wrote: > > Hi, > > consider the following code: > > uint16_t testa4(uint8_t x, uint8_t y) { > return ( (uint16_t)x << 0 ) > | ( (uint16_t)y << 8 ); > } > uint16_t testb3(

Re: [cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread Sven Köhler via cfe-users
Am 16.11.20 um 21:49 schrieb David Blaikie via cfe-users: > On Mon, Nov 16, 2020 at 12:36 PM Sven Köhler via cfe-users > wrote: >> >> Can you elaborate what is happening here? > > I believe/would guess the goal is to reduce false positives (where a > false positive is

Re: [cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread David Blaikie via cfe-users
On Mon, Nov 16, 2020 at 4:49 PM Sven Köhler via cfe-users wrote: > > Am 16.11.20 um 21:49 schrieb David Blaikie via cfe-users: > > On Mon, Nov 16, 2020 at 12:36 PM Sven Köhler via cfe-users > > wrote: > >> > >> Can you elaborate what is happening here? >

Re: [cfe-users] -Wconversion does not produce warnings when it should

2020-11-16 Thread Marshall Clow via cfe-users
> On Nov 16, 2020, at 6:42 PM, David Blaikie via cfe-users > wrote: > > On Mon, Nov 16, 2020 at 4:49 PM Sven Köhler via cfe-users > mailto:cfe-users@lists.llvm.org>> wrote: >> >> Am 16.11.20 um 21:49 schrieb David Blaikie via cfe-users: >>> On Mon

[cfe-users] Avoiding duplications within an interpreter switch

2020-11-21 Thread Eliot Miranda via cfe-users
Hi All, I'm a happy clang user across several platforms for Smalltalk VM development. One version of the VM is an interpreter that supports two bytecode sets. Its main dispatch loop combines dispatches for two bytecode sets, one offset by 256 from the other. So the range of cases in the swit

[cfe-users] clang for embedded, C runtime support, and crt*.o

2020-11-23 Thread Andrew Pullin via cfe-users
Hi folks, I have recently been looking at using clang to build firmware code targeting the ARM Cortex-M microcontrollers, where arm-gcc is the de facto standard tool. I did find some good write-ups around online to follow and get me started, but I ran into an issue that goes beyond my curren

[cfe-users] Missing AST Node for parsing code with std::vector::data()

2020-12-03 Thread Владимир Фролов via cfe-users
Greetings! I'm using clang for source-to-source translation. Recently I got a problem with parsing code which use templates.First, here is the working example: struct MyTestVector2{ unsigned int _data[6]; unsigned int * data() { return &_data[0]; }};... MyTestVector2 testData2;kernel_TestColor(&hit

Re: [cfe-users] Missing AST Node for parsing code with std::vector::data()

2020-12-03 Thread David Blaikie via cfe-users
You might need to provide more details - at least a cursory example shows the function call in the ast dump: https://godbolt.org/z/zvqTa3 On Thu, Dec 3, 2020 at 4:02 AM Владимир Фролов via cfe-users < cfe-users@lists.llvm.org> wrote: > Greetings! I'm using clang for source-to-sour

Re: [cfe-users] Missing AST Node for parsing code with std::vector::data()

2020-12-14 Thread Richard Smith via cfe-users
On Thu, 3 Dec 2020 at 04:02, Владимир Фролов via cfe-users < cfe-users@lists.llvm.org> wrote: > Greetings! I'm using clang for source-to-source translation. > > Recently I got a problem with parsing code which use templates. > First, here is the working example: &

[cfe-users] (closed) Missing AST Node for parsing code with std::vector::data()

2020-12-14 Thread Владимир Фролов via cfe-users
functions from to processed source code, then finally i got AST parsed correcty. Thank you very much, clang is awesome!  15.12.2020, 10:15, "Richard Smith" :On Thu, 3 Dec 2020 at 04:02, Владимир Фролов via cfe-users <cfe-users@lists.llvm.org> wrote:Greetings! I'm using

[cfe-users] [PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more portable alternative

2020-12-21 Thread Alejandro Colomar via cfe-users
Reported-by: Heinrich Schuchardt Signed-off-by: Alejandro Colomar --- man2/cacheflush.2 | 24 1 file changed, 24 insertions(+) diff --git a/man2/cacheflush.2 b/man2/cacheflush.2 index aba625721..7a2eed506 100644 --- a/man2/cacheflush.2 +++ b/man2/cacheflush.2 @@ -86,6 +

Re: [cfe-users] [PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more portable alternative

2020-12-21 Thread Heinrich Schuchardt via cfe-users
On 12/14/20 12:43 PM, Alejandro Colomar wrote: Reported-by: Heinrich Schuchardt Signed-off-by: Alejandro Colomar Reviewed-by: Heinrich Schuchardt --- man2/cacheflush.2 | 24 1 file changed, 24 insertions(+) diff --git a/man2/cacheflush.2 b/man2/cacheflush.2 ind

Re: [cfe-users] cacheflush.2

2020-12-21 Thread Martin Sebor via cfe-users
On 12/11/20 11:14 AM, Alejandro Colomar (man-pages) via Gcc wrote: It looks like GCC recently moved from 'char *' to 'void *'. This SO question[1] (4 years ago) quotes the GCC docs and they had 'char *'. __builtin___clear_cache in GCC has always been declared to take void*. The signature in th

[cfe-users] [PATCH v6] cacheflush.2: Document __builtin___clear_cache() as a more portable alternative

2020-12-21 Thread Alejandro Colomar via cfe-users
Reported-by: Heinrich Schuchardt Signed-off-by: Alejandro Colomar Cc: Martin Sebor Cc: Dave Martin --- v6: - GCC has always exposed 'void *', as Martin Sebor noted. It's Clang (and maybe others) that (following GCC's docs) exposed 'char *'. man2/cacheflush.2 | 24

Re: [cfe-users] Ping: cacheflush.2

2020-12-21 Thread Martin Sebor via cfe-users
On 12/18/20 3:42 AM, Alejandro Colomar (man-pages) wrote: Hi Martin, I sent you an email, but I received a "delivery failure". If you're reading this from a list, could you answer, please? Thanks, Alex On 12/14/20 11:34 PM, Alejandro Colomar (man-pages) wrote: Hello Martin, Thanks for the c

[cfe-users] Making private types public

2021-01-03 Thread Volker Weißmann via cfe-users
Hello, If you define a type privately (or protected) like this: class c {     class priv{}; }; then the writing "c::priv" outside of the class c will generate the error "'class c::priv' is private within this context". This is really bad for me, because I'm currently writing a tool that gen

Re: [cfe-users] Making private types public

2021-01-03 Thread Matthew Fernandez via cfe-users
> On Jan 3, 2021, at 16:12, Volker Weißmann via cfe-users > wrote: > > Hello, > > If you define a type privately (or protected) like this: > > class c { > > class priv{}; > > }; > > then the writing "c::priv" outside of the cl

[cfe-users] Machine code footprint

2021-01-10 Thread Marcel Keller via cfe-users
Hi, When I compile the attached code, I find that one instantiation of vector::_M_fill_insert is double the size of the other even though the semantics should be the same: $ clang++ -O3 -g -c insert.cpp $ nm insert.o --size-sort -Ctd 0079 W std::vector > f() 0079 W st

Re: [cfe-users] Machine code footprint

2021-01-10 Thread David Blaikie via cfe-users
_iterator > >, unsigned long, long const&) On Sun, Jan 10, 2021 at 11:11 AM Marcel Keller via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > When I compile the attached code, I find that one instantiation of > vector::_M_fill_insert is double the size of the oth

[cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-11 Thread Ayush Mittal via cfe-users
Hello Cfe Users, Could you please point to an effective way to get Source Location details from an IR code. >From the documentation, I think this could be a way: Function Pass-> LLVM Value-> MDN->DILocation-> Source Location. Please include any example if the above approach is correct too. Thanks

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-11 Thread David Blaikie via cfe-users
On Mon, Jan 11, 2021 at 4:33 PM Ayush Mittal via cfe-users < cfe-users@lists.llvm.org> wrote: > Hello Cfe Users, > > Could you please point to an effective way to get Source Location details > from an IR code. > From the documentation, I think this could be a way: > Fu

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-12 Thread Bella V via cfe-users
at 6:31 PM David Blaikie wrote: > > > On Mon, Jan 11, 2021 at 4:33 PM Ayush Mittal via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hello Cfe Users, >> >> Could you please point to an effective way to get Source Location details >> from an IR

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-12 Thread David Blaikie via cfe-users
; appending to MDS. > F.hasMetadata() also returns false. What would be the way to get debugLoc > in these scenario? > > Thanks and Regards. > > On Mon, Jan 11, 2021 at 6:31 PM David Blaikie wrote: > >> >> >> On Mon, Jan 11, 2021 at 4:33 PM Ayush Mitt

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-15 Thread Bella V via cfe-users
() also returns false. What would be the way to get debugLoc >> in these scenario? >> >> Thanks and Regards. >> >> On Mon, Jan 11, 2021 at 6:31 PM David Blaikie wrote: >> >>> >>> >>> On Mon, Jan 11, 2021 at 4:33 PM Ayush Mittal via cfe

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-17 Thread David Blaikie via cfe-users
in >>> function pass, when I do F.getAllMetadata(MDs), i do not see any metadata >>> appending to MDS. >>> F.hasMetadata() also returns false. What would be the way to get debugLoc >>> in these scenario? >>> >>> Thanks and Regards. >>> >&

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-26 Thread Bella V via cfe-users
gt; >>> > >>> Thanks and Regards. > >>> > >>> On Mon, Jan 11, 2021 at 6:31 PM David Blaikie > wrote: > >>>> > >>>> > >>>> > >>>> On Mon, Jan 11, 2021 at 4:33 PM Ayush Mittal via cfe-users <

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-26 Thread David Blaikie via cfe-users
gt;> >>> Do we have to initially attach some metadata to the Value? Because in >> function pass, when I do F.getAllMetadata(MDs), i do not see any metadata >> appending to MDS. >> >>> F.hasMetadata() also returns false. What would be the way to get >> d

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-26 Thread Bella V via cfe-users
-g >>> >> >>> >> On Tue, Jan 12, 2021 at 1:22 PM Bella V >>> wrote: >>> >>> >>> >>> Do we have to initially attach some metadata to the Value? Because >>> in function pass, when I do F.getAllMetadata(MDs), i do not see any >>> metadat

Re: [cfe-users] Get Source Location details from IR code (Function Pass)

2021-01-27 Thread David Blaikie via cfe-users
;> wrote: >>>> >> >>>> >> You'd have to get IR from somewhere that has attached debug info - >>>> such as clang -g >>>> >> >>>> >> On Tue, Jan 12, 2021 at 1:22 PM Bella V >>>> wrote: >>

[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

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] 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-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). > > > >

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-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-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

[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 +

[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] 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] 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] 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] 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

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

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

[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] 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] 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] [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

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
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
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. >

[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

[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

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] 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

[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] 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

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

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-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

[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

[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

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: > &

[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] 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

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
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-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-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

[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] 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 &

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
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) >> >&

[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

[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 =

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] 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] 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

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

<    6   7   8   9   10   11   12   13   >