Questions tagged [llvm-clang]

Clang is the C language family front-end for the LLVM compiler. (The C language family includes C, C++, Objective-C, and Objective-C++.)

Clang refers to the C language family front-end for the LLVM (originally known as "low level virtual machine") compiler. The C language family consists of C, C++, Objective-C, and Objective-C++.

High-level features of clang include better compile-time performance than gcc, helpful error and warning messages, and a static analyzer to automatically detect software bugs.

1101 questions
0
votes
0 answers

Clang RecursiveASTVisitor warning message?

When running my RecursiveASTVisitor program on Objective C codes, I keep getting this warning warning: unknown warning option '-Wno-receiver-is-weak'; did you mean '-Wno-receiver-expr'? [-Wunknown-warning-option] But I didn't compile it with…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

Getting information from ObjCPropertyRefExpr in Clang AST

ObjCPropertyRefExpr 0x7fc2f9a80ac0 '' lvalue objcproperty Kind=PropertyRef Property="text" Messaging=Getter `-OpaqueValueExpr 0x7fc2f9a80aa0 'UITextField *' `-PseudoObjectExpr 0x7fc2f9a61d30 'UITextField *' …
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

Clang AST - isNullPointerConstant()

I'm trying to check if input arguments to a CallExpr is null/nil in Objective C using Clang's AST I saw that there is a method isNullPointerConstant() that seems like it will do what I want…
0
votes
0 answers

variable/memory management in clang/c++?

class MyASTVisitor : public RecursiveASTVisitor { private: ASTContext *Context; std::map localMap; public: explicit MyASTVisitor(ASTContext *Context) : Context(Context) {} bool…
0
votes
0 answers

Iterate subtree of clang

I have detected all the places where there are assignment statements by visiting Binary Operators that are "=" From there I got the LHS and RHS by doing binaryOperator->getLHS() and getRHS() respectively How should I go about iterating through all…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

How to check if ObjCPropertyRefExpr is of type UITextField

I'm able to retrieve the node ObjectiveCPropertyRefExpr out and I want to check if it's referring to something from the UITextField (in the future I want to check for other user input fields too). Is there a way to check if the…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

Retrieve LHS/RHS value of operator

I'm looking to do something similar to this how to get integer variable name and its value from Expr* in clang using the RecursiveASTVisitor The goal is to first retrieve all assignment operations then perform my own checks on them, to do taint…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

Error when compiling llvm in FreeBSD 8.4

I am trying to build LLVM from source in FreeBSD 8.4. Here are the steps i carried out Downloaded the source from http://llvm.org/releases/3.8.0/llvm-3.8.0.src.tar.xz Extracted the source into a folder. Created a build directory and inside it ran…
sushil
  • 165
  • 1
  • 9
0
votes
1 answer

Apple Clang on Debian8.1

Recently I'm porting Apple Clang-700.1.81 to debian 8.1. I have successfuly build clang with cmake ../llvm -DLLVM_TARGET_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX="/usr" -DDLLVM_DEFAULT_TARGET_TRIPLE="x86_64-apple-darwin15.3.0" Make clang -j8 -s…
Deflinhec
  • 65
  • 7
0
votes
1 answer

LLVM 3.8: implementing a pass with ad IDE (Xcode)

I'm a newbie in both LLVM developing and cpp. I wanted to ask if there was a way to develop a pass for LLVM in Xcode having all the typical features available in an IDE like autocomplete and syntax code highlighting. Right now I am just writing c++…
Carlinho89
  • 157
  • 2
  • 14
0
votes
1 answer

Omitted code blocks from clang AST for ObjectiveC

I was generating AST for Objective C code on a .m file The command is roughly like clang-check -ast-dump /source/file.m &> /output/file.txt It had an error that said Error while trying to load a compilation database: Could not auto-detect…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

how to catch for/while statement with clang in python

I calculate C/C++ code's cyclomatic complexity with clang in python module. And, I caught almost statement but, I can't catch several statement that don't have a brace. example, if below statement can catch and calculate cyclomatic complexity. if (i…
0
votes
1 answer

What is the minimum compute capability for CUDA compilation supported by LLVM compiler?

A CUDA source file can be compiled into PTX format using LLVM compiler with the command clang -Xclang -I$LIBCLC/include/generic -I$LIBCLC/include/ptx -Dcl_clang_storage_class_specifiers -O3 cudaFile.cu -S -o ptxOutputFile.ptx…
Ginu Jacob
  • 1,588
  • 2
  • 19
  • 35
0
votes
1 answer

LLVM3.8 Makefile.config, Makefile.common and Makefile.rule missing in build folder

so I'm learning about llvm and I decided to build the 3.8 from the tars that I downloaded from LLVM site. Everything works fine and I managed to build the sources in a separate build folder. (After downloading all the sources) $cd…
Carlinho89
  • 157
  • 2
  • 14
0
votes
1 answer

Obfuscator-LLVM + xcode clang 3.4: "unknown argument"

I'm having a real hard time using Obfuscator-LLVM in Xcode.. I don't understand why, after creating the plugin for it and selecting it in my build settings, I can't compile because clang is giving this "unknown arguments" errors. clang-3.4: error:…
Carlinho89
  • 157
  • 2
  • 14