llvm-clang

Why does std::put_time not compile using multiple compilers?

丶灬走出姿态 提交于 2019-12-24 10:58:19
问题 std::put_time does not seem to work. The following snippet is taken directly from en.cpp.reference.com. #include <iostream> #include <iomanip> #include <ctime> int main() { std::time_t t = std::time(nullptr); std::tm tm = *std::localtime(&t); std::cout.imbue(std::locale("ru_RU.utf8")); std::cout << "ru_RU: " << std::put_time(&tm, "%c %Z") << '\n'; std::cout.imbue(std::locale("ja_JP.utf8")); std::cout << "ja_JP: " << std::put_time(&tm, "%c %Z") << '\n'; } Several compilers agree that put_time

How to intall Clang 9 on Mac?

女生的网名这么多〃 提交于 2019-12-24 10:25:32
问题 Here's what I have on my Mac: clang --version Apple LLVM version 10.0.0 (clang-1000.10.44.4) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin my app needs to be compiled with clang version 9, how can I install it on my Mac? I went to LLVM official site, but I don't see Clang 9 there. Any help is greatly appreciated! 回答1: I downloaded Xcode 9.2 and then did xcode-select -s /Applications/Xcode.app/Contents/Developer and then my

compiling libc++ with clang++ in Ubuntu

我们两清 提交于 2019-12-24 09:49:39
问题 My OS is Ubuntu-11.04 i compiled llvm with clang as per the user manual successfully. then i tried to compile libcxx with clang++, i made modifications to the $LIBCXX_DIR/lib/buildit.sh by reading the following http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013228.html The modified file $LIBCXX_DIR/lib/buildit is pasted after the error message. with the modified buildit.sh i get following errors. It seems clang++ is unable to compile the header file 'string' successfully. Here is

LLVM 6 Trunk Build on Ubuntu 16.04 not building lld

蓝咒 提交于 2019-12-24 09:17:57
问题 I am building LLVM 6 on Ubuntu 16.04. I want lld too. But no matter what I do, lld doesn't build/install. Followed the following instruction from here. Still sifting through first and second :) Read the documentation. Read the documentation. Remember that you were warned twice about reading the documentation. In particular, the relative paths specified are important. Checkout LLVM: cd where-you-want-llvm-to-live svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm Checkout Clang: cd where

Clang AST dump doesn't show #defines

最后都变了- 提交于 2019-12-24 02:58:40
问题 I'm dumping the AST of some headers like this: clang -cc1 -ast-dump -fblocks header.h However, any #define s on the header are not showing on the dump. Is there a way of adding them? 回答1: It's true, #defines are handled by the preprocessor, not the compiler. So you need a preprocessor parser stage. I know of two: Boost Wave can preprocess the input for you, and/or give you hooks to trigger on macro definitions or uses. The Clang tool pp-trace uses a Clang library that can do callbacks on many

Clang AST dump doesn't show #defines

邮差的信 提交于 2019-12-24 02:58:07
问题 I'm dumping the AST of some headers like this: clang -cc1 -ast-dump -fblocks header.h However, any #define s on the header are not showing on the dump. Is there a way of adding them? 回答1: It's true, #defines are handled by the preprocessor, not the compiler. So you need a preprocessor parser stage. I know of two: Boost Wave can preprocess the input for you, and/or give you hooks to trigger on macro definitions or uses. The Clang tool pp-trace uses a Clang library that can do callbacks on many

How to compile c99-to-c89 convertor with clang?

六月ゝ 毕业季﹏ 提交于 2019-12-23 04:34:38
问题 I'm trying to compile ffmpeg in windows for VisualStudio and one of the step is to compile c99-to-c89 code with clang according to this post. I managed to create clang.exe but how I compile c99-to-c89 code with it? I changed a little bit the makefile in c99-to-c89 so CC variable points now to clang.exe compiler and not cl.exe EXT=.exe all: c99conv$(EXT) c99wrap$(EXT) CLANGDIR=C:/build CC=C:/build/bin/Release/clang.exe CFLAGS=-nologo -Z7 -D_CRT_SECURE_NO_WARNINGS=1 -Dpopen=_popen -Dunlink=

How to compile c99-to-c89 convertor with clang?

大兔子大兔子 提交于 2019-12-23 04:34:00
问题 I'm trying to compile ffmpeg in windows for VisualStudio and one of the step is to compile c99-to-c89 code with clang according to this post. I managed to create clang.exe but how I compile c99-to-c89 code with it? I changed a little bit the makefile in c99-to-c89 so CC variable points now to clang.exe compiler and not cl.exe EXT=.exe all: c99conv$(EXT) c99wrap$(EXT) CLANGDIR=C:/build CC=C:/build/bin/Release/clang.exe CFLAGS=-nologo -Z7 -D_CRT_SECURE_NO_WARNINGS=1 -Dpopen=_popen -Dunlink=

How to tell clang that my LLVM Target should use 16-bit 'int'?

天涯浪子 提交于 2019-12-22 17:59:55
问题 For my PIC Backend, I want 'int' to be 16 bits. How can I / my target tell clang what should be the size of 'int'? Defining 16-bit registers only seems not sufficient. Currently "clang -O2 -emit-llvm -target pic" converts int foo(int a, int b) { return a + b; } to this IR code, using 32-bit integers: ; ModuleID = '../test/sum.c' source_filename = "../test/sum.c" target datalayout = "e-m:e-p:16:16-i16:16-a:0:16-n16-S16" target triple = "pic" ; Function Attrs: norecurse nounwind readnone define

'ext/slist' file not found on OS X 10.9

孤街醉人 提交于 2019-12-22 08:54:50
问题 I am trying to get some older third-party software to compile on OS X 10.9. I've managed to get rid of most compilation problems by adjusting settings in the Makefiles, which were originally written for gcc probably around 2005. However, I currently don't know how to overcome this error for a C++ source file: /utility.h:42:10: fatal error: 'ext/slist' file not found I understand that ext/slist belongs to some version of STL. Has that version been superseded or does it have to be activated in