[cfe-users] Quickly find the CXCursor for a declaration based on the cursors name?

2016-01-22 Thread via cfe-users
Hi, I am using libclang to process large PCH files. Within the translation units for the PCH files I need to locate the CXCursor of a declaration based on an arbitrary name. Currently I use something similar to the following which is terrible performance wise: // start a search in this transla

[cfe-users] Trouble with clang::SourceManager and clang::ASTUnit

2016-12-12 Thread via cfe-users
Hi all, I'm writing an auto-completion plug-in for Sublime Text 3 with a compiled component in C++. The compiled component is written as a clang tool living in llvm/tools/clang/tools/ and it links with the clangFrontend library. The bridge between Sublime's Python interface and C++ is pybind1

[cfe-users] clang-cl fails to link program with deleted copy constructor

2017-05-02 Thread via cfe-users
Given this program: #include class X : public std::runtime_error { public: X() : std::runtime_error("X") {} ~X() override = default; X(const X& other) = delete; X& operator = (const X&) = delete; X(X&& other) : std::runtime_error(other.what()) {} }; int main(int argc, char

[cfe-users] cfe-users Digest, Vol 54, Issue 4

2017-08-01 Thread via cfe-users
reach the person managing the list at cfe-users-ow...@lists.llvm.org When replying, please edit your Subject line so it is more specific than "Re: Contents of cfe-users digest..." Today's Topics: 1. [analyzer] clang analyzer flag vs scan build (Cyndy Ishida via cfe-users) 2. Re:

Re: [cfe-users] confirm 041d793418bcfea32adb6add2a4cdea1ee7b78be

2017-08-09 Thread via cfe-users
> Mailing list removal confirmation notice for mailing list cfe-users > > We have received a request from 46.218.101.203 for the removal of your > email address, "poue...@openmailbox.org" from the > cfe-users@lists.llvm.org mailing list. To confirm that you want to be > removed from this mailing

[cfe-users] Problem compiling simple main.c with llvm-5.0

2017-12-13 Thread via cfe-users
Hi, I am new to llvm, so my first question is if this is the right mailing list to address respective problems using that software. I downloaded the llvm 5.0.0 binary bundle, and I can compile simple main.c for x64_64 host. However, when .../bin/clang main.c --target=avr error: unable to create

Re: [cfe-users] [cfe-dev] C++ Scoring Tool

2018-04-22 Thread via cfe-users
On 2018-04-17 02:38, Manuel Klimek via cfe-users wrote: On Tue, Apr 17, 2018 at 8:33 AM Jonas Toth via cfe-dev wrote: +cfe-dev The people familiar with clang-format are more likely active there :) Am 17.04.2018 um 09:40 schrieb Daniel via cfe-users: Hello, For the senior project in my

[cfe-users] add method to a existing class and save to source file

2018-05-04 Thread ? ?? via cfe-users
Dear Clang users: I have a class named classA in a.h and a.cpp file. it have some methods, I want to add a new method definition to a.h and add new method body after last method use clang . How to do it ? I know the RecursiveASTVisitor::VisitCXXRecordDecl(...) can visit CXXRecordD

[cfe-users] dynmaic_cast in uninstantiated function templates

2018-10-23 Thread via cfe-users
Hi list, the code below compiles on gcc and icc, but not on clang with the error: source_file.cpp:14:16: error: 'B' is an incomplete type if (auto b = dynamic_cast(a)) However fn is an uninstantiated function template. Is this a glitch in clang or is clang the only one right here? Best Olaf

Re: [cfe-users] dynmaic_cast in uninstantiated function templates

2018-11-05 Thread via cfe-users
Thanks for the clarification. So a solution could be a template make_dependent template struct make_dependent { typedef X type; }; template void fn(A* a, T& x) { dynamic_cast::type>(a); } The standard doesn't supply any similar, does it? Best Olaf -Ursprüngliche Nachricht- Von: M

[cfe-users] clang/llvm fails to vectorize a simple fill loop

2019-02-04 Thread via cfe-users
Hi @all, can anyone tell me, what is wrong with the following loop in Fill: https://godbolt.org/z/hyZ2HO Vectorization works for float, double and std::complex, but it fails for std::complex. The remark "read with atomic ordering or volatile read" hints for something, but neither do I know ex

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

[cfe-users] Why doesn't clang use colors for diagnostics by default?

2015-09-07 Thread Victor via cfe-users
Hello, all. Why doesn't clang use colors for diagnostics by default? My environment: $ cat /etc/*-release Red Hat Enterprise Linux Server release 6.3 (Santiago) $ echo $TERM xterm Doc here http://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics says: "This option, which default

[cfe-users] Generate mingw object files via clang-cl

2015-09-09 Thread JVApen via cfe-users
Hi all We are looking at a large project that has been written only with the MSVC compiler. I've already tried to compile this with Clang-Cl, which goes actually very nicely and already uncovered some bugs. (Let me thank all developers that already worked on making clang-cl such a good tool) Unfo

Re: [cfe-users] Why doesn't clang use colors for diagnostics by default?

2015-09-10 Thread Victor via cfe-users
needed to detect a color terminal, and defaults to no color. On Mon, Sep 7, 2015 at 5:15 AM, Victor via cfe-users < cfe-users@lists.llvm.org> wrote: Hello, all. Why doesn't clang use colors for diagnostics by default? My environment: $ cat /etc/*-release Red Hat Enterprise Linux S

Re: [cfe-users] Why doesn't clang use colors for diagnostics by default?

2015-09-10 Thread Victor via cfe-users
color inside tmux and it works fine. hth... don On Thu, Sep 10, 2015 at 2:40 AM, Victor via cfe-users < cfe-users@lists.llvm.org> wrote: I'm using command like this: $ clang++ prg.cpp My Clang is built from sources. What libraries it needs to use colors automatically? Or may be ther

Re: [cfe-users] Why doesn't clang use colors for diagnostics by default?

2015-09-10 Thread Victor via cfe-users
, Victor via cfe-users < cfe-users@lists.llvm.org> wrote: I'm using command like this: $ clang++ prg.cpp My Clang is built from sources. What libraries it needs to use colors automatically? Or may be there is some option that I can specify for configure? On Wed, 9 Sep 2015 19:

Re: [cfe-users] Why doesn't clang use colors for diagnostics by default?

2015-09-11 Thread Victor via cfe-users
works fine. hth... don On Thu, Sep 10, 2015 at 2:40 AM, Victor via cfe-users < cfe-users@lists.llvm.org> wrote: I'm using command like this: $ clang++ prg.cpp My Clang is built from sources. What libraries it needs to use colors automatically? Or may be there is some option that I

Re: [cfe-users] Errors when trying to use libcxx/libcxxabi with memory sanitizer

2015-11-23 Thread MeldaProduction via cfe-users
unsubscribe Cheers! Vojtech www.meldaproduction.com Facebook <https://www.facebook.com/MeldaProduction>, Twitter <http://twitter.com/meldaproduction>, Youtube <http://www.youtube.com/user/meldaproduction> 2015-11-23 20:13 GMT+01:00 Schlottke-Lakemper, Michael via cfe

Re: [cfe-users] Emit LLVM IR from OpenCL

2016-01-16 Thread PanXiuli via cfe-users
Hi Zheng, You can find some examples in test/CodeGenOpenCL/, but they are not builtin functions. The warning is because these buitin functions need implementation for the target device, so it is normal that these builtin functions does not have declarations of definitions in clang. If you want t

Re: [cfe-users] static inline functions in headers and -Wunused-function

2016-01-27 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 , David Blaikie via cfe-users writes: > On Wed, Jan 27, 2016 at 3:01 AM, Rainer Gerhards via cfe-users < >

Re: [cfe-users] static inline functions in headers and -Wunused-function

2016-01-27 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 , David Blaikie via cfe-users writes: > On Wed, Jan 27, 2016 at 3:01 AM, Rainer Gerhards via cfe-users < >

[cfe-users] dereferencing null pointers

2016-04-25 Thread Zenith432 via cfe-users
target is x86_64-apple-darwin15.4.0 (Apple LLVM 7.3.0) This function = vec.c = #include int vec(int index) { return ((int*) NULL)[index]; } === [Yes, I know it's undefined behavior in ansi C]. Compiled with "clang -c -O0 -o vec.o vec.c" yields this code = 000

[cfe-users] clang x86 assembler 8-bit displacements

2016-04-26 Thread Zenith432 via cfe-users
This time a question about the integrated assembler --- code .code32 .data L1: .quad 88 .equ L2, . - L1 .byte 29 .text mov 55(%ebx), %eax mov L2(%ebx), %eax end code clang -c -o file.o file.s gives this - 8b4337 movl

[cfe-users] binary operator

2016-07-12 Thread folkert via cfe-users
Hi, When iterating through the AST I encounter BinaryOperator-s, part of an IfStmt. My question now is: how can I find which operator it is? E.g. ==, >=, etc. I'm using libclang. Folkert van Heusden -- -- Phone: +31-6-4127812

Re: [cfe-users] binary operator

2016-07-12 Thread folkert via cfe-users
Hi, > > When iterating through the AST I encounter BinaryOperator-s, part of an > > IfStmt. > > My question now is: how can I find which operator it is? E.g. ==, >=, > > etc. > > I'm using libclang. > > You can call BinaryOperator::getOpcode, which will return an Opcode, > which is a typedef of t

Re: [cfe-users] binary operator

2016-07-13 Thread folkert via cfe-users
> > When iterating through the AST I encounter BinaryOperator-s, part of an > > IfStmt. > > My question now is: how can I find which operator it is? E.g. ==, >=, > > etc. > > I'm using libclang. > > > > You can call BinaryOperator::getOpcode, which will return an Opcode, > which is a typedef of th

[cfe-users] link order for libtooling

2016-07-14 Thread folkert via cfe-users
Hi, What is the order of the clang libraries when linking? Currently I'm doing: clang++ -fno-rtti `llvm-config --cxxflags` \ iterate.cpp \ `llvm-config --ldflags --libs --system-libs` \ -I/usr/lib/llvm-3.8/include -ggdb3 -std=c++11 -I/usr/include/llvm-3.8/llvm/Support -L

Re: [cfe-users] link order for libtooling

2016-07-15 Thread folkert via cfe-users
gt; return rso.str(); > } > > It shoudl work for any C or C++ declaration. > > Thank you, > > [0] https://github.com/esbmc/esbmc > [1] > https://github.com/esbmc/esbmc/blob/master/scripts/build-aux/m4/ax_clang.m4 > [2] > https://github.com/esbmc/esbmc/blob/master/s

[cfe-users] parsing a windows source

2016-07-21 Thread folkert via cfe-users
Hi, I would like to parse a windows source. Using clang/llvm and preferably under Linux. I'm using: std::vector arguments; arguments.push_back("-fms-compatibility"); arguments.push_back("-fms-extensions"); arguments.push_back("-Wno-error=invalid-token-paste");

[cfe-users] Expr objects and Evaluate*

2016-08-01 Thread folkert via cfe-users
Hi, I have an Expr object. How can I know if I can invoke EvaluateAsBooleanCondition, EvaluateAsRValue, EvaluateAsInt and EvaluateAsFloat ? Because if I just call them on any Expr object, I get assertions like: llvm/tools/clang/include/clang/AST/Type.h:612: const clang::ExtQualsTypeCommonBase* c

[cfe-users] traversing the ast using libtooling

2016-08-04 Thread folkert via cfe-users
Hi, When I want to walk over the complete ast and visit each node (by using a RecursiveASTVisitor<...>), do I need to implement all of TraverseDecl, TraverseStmt and TraverseType? Because with all of those it looks like some code is processed twice. Second question: there are other Traverse...-me

[cfe-users] Problems with block

2016-08-07 Thread W.Boeke via cfe-users
I wanted to investigate how Clang facilitates a kind of object-oriented programming style, using blocks. A first experiment was as follows: // crash1.c #include int (^f)(); void func() { __block int ext; f=^int { ext=7; printf("ext=%d\n",ext); return ext; }; } int main() {

[cfe-users] uniquely identifying names

2016-08-26 Thread folkert via cfe-users
Hi, The Sun java compiler allows you to (from java) walk the AST and investigate it. Each token is stored in an object. Each object has a hash() method which uniquely identifies it. Now I was wondering: can I do so with the LLVM tooling as well? I could of course if I want to identify e.g. a func

Re: [cfe-users] uniquely identifying names

2016-08-30 Thread folkert via cfe-users
tions, etc)) > > On Fri, Aug 26, 2016 at 5:11 AM folkert via cfe-users < > cfe-users@lists.llvm.org> wrote: > > > Hi, > > > > The Sun java compiler allows you to (from java) walk the AST and > > investigate it. Each token is stored in an object. Each object

[cfe-users] libclang: Spelling on typedefs lacks namespaces

2016-08-30 Thread Michael via cfe-users
Hi Hope I picked the right place for this kind of problem, if not please let me know. I'm using libclang to parse header files and generate code from them. I found that clang_getTypeSpelling() usually includes the namespace(s) a type was declared in. However with the exception being typedefs

Re: [cfe-users] uniquely identifying names

2016-08-31 Thread folkert via cfe-users
gt; > > Le 30 août 2016 à 17:40, David Blaikie via cfe-users > > a écrit : > > > > Do you want to identify the same entity across a valid program's various > > source files? Across changes to that program? (what changes?) > > > > If you want to d

[cfe-users] diagnostics

2016-08-31 Thread folkert via cfe-users
Hi, Something strange is happening while parsing using std::unique_ptr au = clang::tooling::buildASTFromCodeWithArgs(code, arguments, llvm::Twine(argv[i])); I get a lot of errors and warning written to stderr (how can I stop that apart from redirecting fd 2 to /dev/null?) but the following doe

[cfe-users] Getting size of Initialized array

2016-09-06 Thread gpu0 via cfe-users
Hi, I am experimenting with Clang. I want to get information of length of initialized array A[10]; global declaration? https://github.com/gpu0/clang-tutorial/blob/master/tut02/bounds-check.c It is a test and I want to do bounds check on it. The source is in file.cpp in the same directory. -- _

[cfe-users] splitting a type

2016-09-08 Thread folkert via cfe-users
Hi, When I retrieve CastExpr::getType().getAsString() then I can get something like: const mytype_t *const ** Can I also somehow retrieve this tokenized? Folkert van Heusden -- -- Phone: +31-6-41278122, PGP-key: 1F28D8AE, ww

[cfe-users] finding the source position (range) of a variable name

2016-09-13 Thread folkert via cfe-users
Hi, Finding the name and position of a function/method is easy: DeclarationNameInfo dni = fd -> getNameInfo(); SourceRange dniSr = dni.getSourceRange(); // dniSr is position and length of name in source file std::string name = dni.getName().getAsString(); // name of function/method But how can

Re: [cfe-users] finding the source position (range) of a variable name

2016-09-14 Thread folkert via cfe-users
> DeclarationNameInfo dni = fd -> getNameInfo(); > SourceRange dniSr = dni.getSourceRange(); // dniSr is position and length of > name in source file > std::string name = dni.getName().getAsString(); // name of function/method > > But how can I get this information for variables? Both the name a

Re: [cfe-users] finding the source position (range) of a variable name

2016-09-14 Thread folkert via cfe-users
The problem can be reproduced with this small example code: http://files.slimwinnen.nl/n-nns.tgz Just run make and then ./parse and you'll see it saying that "! NO NestedNameSpecifier". The test-code is test.cpp and the file it parses is example.cpp. > > DeclarationNameInfo dni = fd -> getNameInf

[cfe-users] dissecting the type of a VarDecl

2016-09-16 Thread folkert via cfe-users
Hi, I have a VarDecl instance for which I want to dissect the type. E.g. a const int a would be a const, an int and the name a / std::vector would be namespace std, vector and so on. The first one is easy but the second one: I have no idea where to begin. Sofar I have the following: #include #

Re: [cfe-users] libclang: Spelling on typedefs lacks namespaces

2016-09-27 Thread Michael via cfe-users
Nobody? Wrong list? Any insight in this would be greatly appreciated. Thanks Michael On 08/30/2016 07:00 PM, Michael via cfe-users wrote: Hi Hope I picked the right place for this kind of problem, if not please let me know. I'm using libclang to parse header files and generate code

Re: [cfe-users] libclang: Spelling on typedefs lacks namespaces

2016-09-27 Thread Michael via cfe-users
lps. -Adam On Tue, Sep 27, 2016 at 8:55 AM, Michael via cfe-users mailto:cfe-users@lists.llvm.org>> wrote: Nobody? Wrong list? Any insight in this would be greatly appreciated. Thanks Michael On 08/30/2016 07:00 PM, Michael via cfe-users wrote: Hi Ho

Re: [cfe-users] libclang: Spelling on typedefs lacks namespaces

2016-09-27 Thread Michael via cfe-users
. + if (!Policy.SuppressScope) +AppendScope(D->getDeclContext(), OS); + IdentifierInfo *II = D->getIdentifier(); OS << II->getName(); spaceBeforePlaceHolder(OS); Thanks Michael On 09/27/2016 02:55 PM, Michael via cfe-users wrote: Nobody? Wrong list? Any insight in this would

[cfe-users] finding source-range of a macro-parameter name

2016-10-17 Thread folkert via cfe-users
Hi, Given: #define W(A) while(A) void myfunc() { W(1) { } } I would like retrieve a string for the "1" parameter of the while-macro. Usually I would use: Lexer::getSourceText(CharSourceRange::getCharRange(sr), sm, LangOptions(), 0); (with 'sr' being a SourceRange and

[cfe-users] the case of the missing label in the switch/case

2016-11-09 Thread folkert via cfe-users
Hi, I maybe very well not understanding something but it looks like a label targetted by a goto, in a switch statement, gets missing: if I iterate through the ast and emit all the stmt/expr/decls, then no label-type is emitted. #include void myfunc(int a) { switch(a) {

Re: [cfe-users] the case of the missing label in the switch/case

2016-11-09 Thread folkert via cfe-users
The problem is that you were using CaseStmt::getRHS instead of CaseStmt::getSubStmt. No idea what getRHS is supposed to return then. On Wed, Nov 09, 2016 at 09:53:28AM +0100, folkert via cfe-users wrote: > Hi, > > I maybe very well not understanding something but it looks lik

[cfe-users] finding in which function/method/scope a Decl is in, the parent so to say

2016-11-11 Thread folkert via cfe-users
Hi, How can I find the parent of a VarDecl? The scope it is in. E.g. function/method or a global. Folkert van Heusden ___ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

[cfe-users] How can clang-format don't put if statements into one line?

2016-12-10 Thread fly2never via cfe-users
Just like the code below, I use clang-format to automatic format my codes if(detectBeats[*beatsCont-2] > detectBeats[*beatsCont-1] || fabs(detectBeats[*beatsCont-2] > detectBeats[*beatsCont-1]) < 1.0){ *beatsCont -=1;} Whatever I set the .clang-formt file, it always formatted like this: i

[cfe-users] clang-check with MSVC command DB

2016-12-14 Thread Ch'Gans via cfe-users
Hi there, Is there a way to get clang-check works with a MSVC compile command database? Clang itself can understand MSVC commands using 'clang.exe --driver-mode=cl', but clang-check doesn't seem to support this. Does anyone knows how do do that or any tip or workaround? I'm using LLVM version 3.

[cfe-users] Thread Safety Analysis Annotations

2017-01-08 Thread JVApen via cfe-users
Hi all, I know already about the Tread Safety Analysis annotations (see http://clang.llvm.org/docs/ThreadSafetyAnalysis.html). I love the idea and would like to use it one day in real production code. However, right now, it seems you should always use macros for indicating this code. These macros

[cfe-users] Get template instantiation pattern for function declaration

2017-03-22 Thread Vlad via cfe-users
Hello,I am trying to collect all template instantiations via traversing AST with RecursiveASTVisitor. I thought I would be able to do it with VisitFunctionDecl from class visitor and getTemplateInstantiationPattern from class FunctionDecl. However, as mentioned in the comment to this method, it ju

[cfe-users] Source transformations in frontend plugin before compilation

2017-05-04 Thread Taddeus via cfe-users
Hi all, I want to annotate malloc(sizeof(X)) calls with the type in the sizeof so that I can use the information in the IR later on (in a transformation plugin). My current approach is to do a somewhat hacky source transformation, replacing the call with: malloc(({ ty * volatile ptr = NULL;

[cfe-users] Clang/LLVM detection on Windows

2017-10-24 Thread degski via cfe-users
Is there a macro defined by Clang that helps to distinguish between Clang/LLVM is called under MinGW/Cygwin and Clang/LLVM with/from MSVC? Have a good day, degski ___ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/

[cfe-users] how to clang Replacements

2017-10-26 Thread Valerio via cfe-users
Hi *, I am working on a tool allowing to modify C++ source code (refactoring). I read in [1] that RefactoringTools is not the best choice in terms of performance, my codebase is quite huge. So I ended up with an implementation leveraging on clang Replacements, w/o RefactoringTools. I have read code

[cfe-users] Source code that seg fault when compiled with clang

2017-12-04 Thread Nicolas.bonfante via cfe-users
Hi all, When I try to compile (with command line : "clang simple.ll -o exec") the llvm ir file in attachment, I get a seg fault. My machine is linux (ubuntu 16.04) machine with an intel i7 and 16gb of ram. I got the following error report : warning: overriding the module target triple with x86

[cfe-users] clang frontend command failed due to signal

2018-01-08 Thread 01_Tyro_10 via cfe-users
Hello everyone: I'm building libcxx on amd64 ubuntu 14.04 for testing cloud9, but encountered the following fatal issue that clang caused. The program arguments are as follows: /home/bruce/Cloud9_Root/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -e

[cfe-users] HELP!The clang crashed and I don't know why

2018-01-14 Thread ???? ?T?? via cfe-users
0x01CBA6DB (0x08F33708 0x08F1F4C4 0x08F33710 0x096FDB38) 0x01CBC8E2 (0x08F1F4C4 0x09A5A2C8 0x 0x08BA9EE0) 0x01C5DB42 (0x08BA9EE0 0x09A5A2C8 0x09A5A2C8 0x08F456E0)

[cfe-users] Understanding AST Cursors, Tokens, Includes

2018-01-28 Thread cooper via cfe-users
I’m experimenting with syntax highlighting using the AST. What I want to do is end up with a stream of tokens for a file; each annotated with a scope, which represents the AST cursors it belongs to (broadest to narrowest) and finally its token kind. The idea is then to apply scoping rules to t

[cfe-users] Why does this testcase fail in clang-60?

2018-03-26 Thread Yuri via cfe-users
This testcase: # include # include # define _I ((complex_t)(1i)) typedef std::complex complex_t; complex_t f(const double omega) {   complex_t p = cos (omega) +  _I * sin (omega);   return p; } works in clang40 and clang50, but fails in clang60: c.c:9:32: error: implicit conversion from '_C

Re: [cfe-users] Why does this testcase fail in clang-60?

2018-03-27 Thread Yuri via cfe-users
On 03/27/18 02:43, Jonas Toth via cfe-users wrote: I believe the default standard did change to c++14. How did you compile? Could you make a case in godbolt.org? I compiled without arguments. Adding -std=c++11 or -std=c++98 doesn't change the error message.

Re: [cfe-users] Why does this testcase fail in clang-60?

2018-03-27 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 , Yuri via cfe-users writes: > On 03/27/18 02:43, Jonas Toth via cfe-users wrote: > > I believe the default standard did

Re: [cfe-users] cfe-users Digest, Vol 63, Issue 2

2018-04-03 Thread degski via cfe-users
On 2 April 2018 at 14:00, via cfe-users wrote: > > > Date: Sat, 31 Mar 2018 23:51:22 -0400 > > From: Jeffrey Walton via cfe-users > > To: "CFE-Users (Clang)" > > Subject: [cfe-users] Problems with hexadecimal constant, > >_mm_se

[cfe-users] Error calling _mm256_cvtps_ph intrinsic on Windows

2018-04-11 Thread degski via cfe-users
When calling the _mm256_cvtps_ph instruction [1] using Clang [2] the following error manifests itself: 1>-- Build started: Project: CRoaringTest, Configuration: Debug x64 -- 1>main.c(19): error : '__builtin_ia32_vcvtps2ph256' needs target feature f16c 1>C:\Program Files\LLVM\lib\clang\7.0.

[cfe-users] -Wcast-align

2018-04-12 Thread degski via cfe-users
I have the following code (C11): #define vector_grow(vec, count) \ do { \ if(!(vec)) { \ size_t *__p = (size_t*) malloc ((size_t)(count) * sizeof(*(vec)) + (sizeof(size_t) * 2)); \ assert(__p); \ (vec) = (vo

[cfe-users] C++ Scoring Tool

2018-04-17 Thread Daniel via cfe-users
Hello, For the senior project in my undergraduate studies, my team and I are developing a tool that will evaluate the format and code conventions of a c++ program, outputting a score and displaying useful messages, very much like pylint for python. The idea is kind of like clang-format excep

[cfe-users] Regressions in clang-6 need to be resolved

2018-05-06 Thread Yuri via cfe-users
There are two FreeBSD ports that fail to compile with clang-6 with errors that don't look like genuine C++ errors. Here are the bug reports with attached testcases: https://bugs.llvm.org/show_bug.cgi?id=36915 https://bugs.llvm.org/show_bug.cgi?id=36916 I suspect these are regressions. Is it

[cfe-users] question about loop unrolling

2018-06-26 Thread luck.caile via cfe-users
test.cpp: int main() { int ret = 0; for (int i = 0; i < 100; i++) { ret += i; } return ret; } Hi, I’m new to clang/llvm recently and interested in doing some stuff in optimization passes. I tried to play above simple test with clang and see if I could get expected llvm IR by enabling llvm l

[cfe-users] Need help with llvm gcov c++ coverage

2018-08-07 Thread MissionSix via cfe-users
Hello, I originally posted this on [llvm-dev] but this is hopefully more relevant. I have an existing test suite I’m gathering coverage numbers for. I'm getting 0% coverage with my C++ code, but the same setup works for C. I've configured the build framework to set the compilation flags as foll

Re: [cfe-users] How to make LLVM IR (SHIFT) in Clang to support complex data type

2018-08-21 Thread rsherry8 via cfe-users
Ge via cfe-users wrote: Hi, All I want IR in Clang to such as SHIFT can support complex number. I tried to write the following code: complex data1; complex data2 = data1 >> 4; The Clang compiler said invalid operands in binary instructions. I guess Clang do the data type check and

[cfe-users] MSVC always trying to rebuild project while using clang-cl (LLVM-vs2014 toolset)

2018-09-04 Thread Aleksei via cfe-users
Hello everyone, I don’t know if I’ve found a bug in clang-cl using Visual Studio 2015, or it’s a quite normal behavior… It would be nice if someone clarify it and (better) fix something in clang-cl, because the current behavior is IMHO very confusing. Background: Visual Studio 2015, versi

[cfe-users] Usage of CLang CUDA target with MinGW stdlib

2018-11-02 Thread KOLANICH via cfe-users
Hello everybody. Could anyone clarify how to use this cuda target (-std=c++11 -x cuda) with MinGW stdlib? I mean I get errors \LLVM-7.0.0-win32\lib\clang\7.0.0\include\cuda_wrappers\new:41:12: error: use of undeclared identifier 'malloc' return ::malloc(size); \LLVM-7.0.0-win32\lib\clang\7.0.0

Re: [cfe-users] Usage of CLang CUDA target with MinGW stdlib

2018-11-09 Thread KOLANICH via cfe-users
gt;> >Basically, there's no owner for CUDA support on windows. Someone >needs >> >to >> >figure out why/how CUDA includes behave differently under mingw and >> >figure >> >out how to work around that in the CUDA wrapper headers in clang. >> >

[cfe-users] Snapshot Updates

2018-11-12 Thread degski via cfe-users
Thumbs up to the person updating the Windows LLVM Snapshot Builds. degski -- *“If something cannot go on forever, it will stop" - Herbert Stein* ___ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Re: [cfe-users] build errors with MinGW-W64 GCC-8.1.0 on Windows

2018-11-12 Thread KOLANICH via cfe-users
Hello, Maarten. I have partially built LLVM with MinGW-w64 8.1.0 (some llvm shared libs needed, not clang and stdlib). For experimenting with build I personally recommend using ninja instead of mingw32-make because it allows resuming without rebuilding everything from scratch if I added a lin

[cfe-users] Updated documentation on cross building LLVM for Musl

2019-02-13 Thread Croepha via cfe-users
I spent some time figuring out how to get Clang and related tools to build against musl starting from a GNU libc system. The result is a GNU-less (no libgcc, libstdc++, and GNU LD, AR...) toolchain. I figured I'd share in the hopes that someone else may find it useful... Note: Clang and friends

[cfe-users] building simple program using libcurl on Win64

2019-06-03 Thread Salda via cfe-users
Hello, see https://stackoverflow.com/questions/56378660/how-to-correctly-statically -link-libcurl-on-windows-using-clang-64bit (https://stackoverflow.com/questions/56378660/how-to-correctly-statically-link-libcurl-on-windows-using-clang-64bit) so.. How do I build simple program using libcurl on 6

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

2019-08-02 Thread Romulo via cfe-users
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 'pure template' code but I don't know how to access the specialized functions (the SourceL

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

2019-08-07 Thread Romulo via cfe-users
Thanks, this solved my problem! On Sun, Aug 4, 2019 at 11:07 PM Richard Smith wrote: > On Fri, 2 Aug 2019 at 15:05, Romulo via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hello there, thanks for your time reading this :) >> >> I am trying to extract th

[cfe-users] clang::FunctionTemplateDecl and constness

2019-08-13 Thread Romulo via cfe-users
Hi there, Is there any specific reason why clang::FunctionTemplateDecl::findSpecialization and clang::FunctionTemplateDecl::getInjectedTemplateArgs don't have a const version? Thanks. ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm

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

2019-08-20 Thread Romulo via cfe-users
this solved my problem! > > On Sun, Aug 4, 2019 at 11:07 PM Richard Smith > wrote: > >> On Fri, 2 Aug 2019 at 15:05, Romulo via cfe-users < >> cfe-users@lists.llvm.org> wrote: >> >>> Hello there, thanks for your time reading this :) >>> >>&

[cfe-users] Clang and CDO, CDQ x64 instructions

2019-12-16 Thread Victor via cfe-users
Hello Clang users and developers! I have problem compiling some generated assembly code with clang: mc.s:35739:2: error: invalid instruction mnemonic 'cdo' Does Clang support x64 CDO and CDQ instructions? The code is generated by MLRISC library. A bit older versions used CQTO/CLTD and that worked

[cfe-users] clangd --clang-tidy: // NOLINT only works sometimes

2020-01-26 Thread tastytea via cfe-users
Hi, I recently started using clangd (9.0.1) with --clang-tidy. I noticed that suppressing diagnostics only sometimes works. For example: using std::array; // NOLINT(misc-unused-using-decls) works with clang-tidy and clangd, but curl_global_init(CURL_GLOBAL_ALL); // NOLINT(hicpp-signed-bitw

Re: [cfe-users] clang-tidy

2020-02-05 Thread JVApen via cfe-users
Hey Mario, I logged a bug for this a long time ago: https://bugs.llvm.org/show_bug.cgi?id=25319 >From what I can see, this still ain't solved. It makes sense to register you onto that one. On Thu, Jan 30, 2020, 19:02 Mario Charest via cfe-users < cfe-users@lists.llvm.org> w

Re: [cfe-users] Silencing errors in TSAN

2020-02-05 Thread JVApen via cfe-users
n Fri, Jan 24, 2020, 16:15 Kyle Edwards via cfe-users < cfe-users@lists.llvm.org> wrote: > Hello all, > > I am attempting to build OpenMPI with TSAN enabled (to TSAN-itize a > project that uses OpenMPI), and am finding that OpenMPI throws lots of > errors in TSAN (not surpr

[cfe-users] (no subject)

2020-02-18 Thread degski via cfe-users
Hi Андре, You need to install "the integration" (with VS) correctly. For VS14 you'll need to use 'old style' integration: https://github.com/degski/Clang.Props . This is a copy job. For VS15, use the plugin on: https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain .

[cfe-users] [clang-format-9] error: unknown key '...'

2020-02-26 Thread Conor . via cfe-users
Hi cfe-users, I am using the .clang-format configuration file provided with the latest linux kernel. >> https://github.com/torvalds/linux/blob/master/.clang-format The end of the clang-format file has 3 dots: ... This is valid YAML Syntax. However, for some reason, when I run clang-format-9 (U

[cfe-users] order of object files at link affects exception catching

2020-04-05 Thread krokus via cfe-users
First of all a preface - This problem was spotted while trying to build a large C++ project which links a close to 100 of object file together, plus libraries. I can't replicate this behavior in a simple isolated test. Just want to understand if potentially this may be caused by clang's compiler or

Re: [cfe-users] order of object files at link affects exception catching

2020-04-08 Thread krokus via cfe-users
Richard, Thanks for the quick response; it gave me some directions to investigate further, otherwise it seemed I got stuck trying to make sense of many moving pieces in this puzzle. So, my understanding is that generally the run-time exception handling should _not_ depend on the order of the link

Re: [cfe-users] order of object files at link affects exception catching

2020-04-14 Thread krokus via cfe-users
> Can you catch the exception with "catch (...)"? I tried this route and added such catch-all clause just at the throw site. Moreover, I put an explicit throw("catch-me") there in hope to see if it wil just get caught rightaway. Nope, the exception is thrown properly, but the catch (...) is not in

Re: [cfe-users] Linking problem with implicit instantiation of constructor/destructor

2020-04-17 Thread krokus via cfe-users
> $ clang++ -o test main.cpp template.cpp > >> /usr/bin/ld: /tmp/main-e2fa2c.o: in function `main': > main.cpp:(.text+0x2f): undefined reference to `Template::Template()' > /usr/bin/ld: main.cpp:(.text+0x4d): undefined reference to > `Template::~Template()' > /usr/bin/ld: main.cpp:(.text+0x82): und

[cfe-users] Template specialization locations

2020-05-06 Thread Romulo via cfe-users
Hi there, Is there a way to find where TemplateTypeParmDecl are (SourceRange) in a FunctionDecl? I'm trying to find every place in the AST where a custom template type is used. Thanks! ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llv

[cfe-users] Are these bugs for the clang compilers?

2020-05-26 Thread Tianyou via cfe-users
Hello everyone, I found some questionable behaviors in the clang compiler. I tried to calculate the smallest number in my machine with clang. I did it by looping as:  a = a / 1.73 In g++, after 1358 loops, I found that a = 4.94066E-324, and the value of a never changes from loop 1358 till the

[cfe-users] Please help

2020-06-14 Thread JacobK622 via cfe-users
To, llvm/clang      Firstly I'd like to preface this by saying a few things:     1. I don't always know what is or isn't socially appropriate to say/ask/do, so please don't get mad at me if I say/ask/do something inappropriate just let me know and I'll try to do better.     2. Sometimes I word

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

  1   2   3   4   5   6   7   8   9   10   >