How to list supported target architectures in clang?

So far as I can tell, there is no command-line option to list which architectures a given clang binary supports, and even running strings on it doesn’t really help. Clang is essentially just a C to LLVM translator, and it’s LLVM itself that deals with the nitty-gritty of generating actual machine code, so it’s not … Read more

What languages can be compiled to WebAssembly (Wasm)? [closed]

WebAssembly support is ever evolving. Right now it is supported by the following languages: C / C++ – has very good (production ready) support via EmScripten, or other minimal LLVM-based toolchains Rust – WebAssembly is an officially supported target, with a highly active community around it. Go – has now supports WebAssembly as an official, … Read more

LLVM vs clang on OS X

LLVM originally stood for “low-level virtual machine”, though it now just stands for itself as it has grown to be something other than a traditional virtual machine. It is a set of libraries and tools, as well as a standardized intermediate representation, that can be used to help build compilers and just-in-time compilers. It cannot … Read more

How to make clang compile to llvm IR

Given some C/C++ file foo.c: > clang -S -emit-llvm foo.c Produces foo.ll which is an LLVM IR file. The -emit-llvm option can also be passed to the compiler front-end directly, and not the driver by means of -cc1: > clang -cc1 foo.c -emit-llvm Produces foo.ll with the IR. -cc1 adds some cool options like -ast-print. … Read more

How to affect Delphi XEx code generation for Android/ARM targets?

We are investigating the issue. In short, it depends on the potential mis-alignment (to 32 boundary) of the Integer referenced by a pointer. Need a little more time to have all of the answers… and a plan to address this. Marco Cantù, moderator on Delphi Developers Also reference Why are the Delphi zlib and zip … Read more

Switching between GCC and Clang/LLVM using CMake

CMake honors the environment variables CC and CXX upon detecting the C and C++ compiler to use: $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ $ cmake .. — The C compiler identification is Clang — The CXX compiler identification is Clang The compiler specific flags can be overridden by putting them into a make override file … Read more

What exactly is LLVM?

LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine code. LLVM can be used as a compiler framework, where you provide the “front end” (parser and lexer) and the “back end” (code that converts LLVM’s representation to actual machine code). LLVM can also act as a JIT compiler … Read more

Does the C++ standard allow for an uninitialized bool to crash a program?

Yes, ISO C++ allows (but doesn’t require) implementations to make this choice. But also note that ISO C++ allows a compiler to emit code that crashes on purpose (e.g. with an illegal instruction) if the program encounters UB, e.g. as a way to help you find errors. (Or because it’s a DeathStation 9000. Being strictly … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)