search for: translationunit

Displaying 7 results from an estimated 7 matches for "translationunit".

2012 Aug 16
2
[LLVMdev] libclang parsing bug
Hey everyone, first of all I just wanted to say thanks :) I've been using libclang for building my own C/C++ IDE and its great. I have, however discovered a bug (which I already submitted on llvm bugzilla but I got the impression that no one reads that :)). If I try to use clang_parseTranslationUnit on this code below: int main() { return reinterpret_cast libclang crashes. This is the code I used to parse the code above: #include <clang-c/Index.h> int main(int argc, char** argv) { CXIndex index = clang_createIndex(0, 0); CXTranslationUnit translationUnit = clang_parseTransla...
2008 Dec 18
0
[LLVMdev] Troubles with clang and llvm libraries and simple Xcode project
...Seems like the libraries are not built correctly, but I can't see anything wrong with the steps I took above. I've included a selection of the linker errors below. /Developer/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols: clang::ASTConsumer::InitializeTU(clang::TranslationUnit&) clang::ASTConsumer::~ASTConsumer() ... vtable for clang::DeclRefExpr vtable for clang::BinaryOperator ... typeinfo for llvm::AliasAnalysis llvm::ConstantFoldCall(llvm::Function*, llvm::Constant* const*, unsigned int) llvm::ConstantFoldInstruction(llvm::Instruction*, llvm::TargetData const...
2016 Mar 30
2
[PATCH/DRAFT] Embed metadata into object file
...solve the question: how do I smuggle some metadata on the module level, from the frontend to the generated object file (in an hopefully sane and reusable manner). So, the solution I thought about was the following. The gathered information is but into a NamedMetadataStringAttr and attached to the TranslationUnitDecl. This would be, as far as I can see, the first annotation on the TranslationUnit level. Attributes seem to me the best solution at that point, since there is already a good infrastructure in clang. TranslationUnitDecl | NamedMetadataAttr implicit llvm.extra_section clang.analysis "I...
2013 Dec 10
0
[LLVMdev] libcang python bindings and working with macros question
...for cursor in children: if cursor.spelling == spelling: return cursor if cursor.displayname == spelling: return cursor """ import scripts.clang.cindex as cindex from scripts.util import get_cursor index = cindex.Index.create() t = cindex.TranslationUnit tu = index.parse('blah.c',[ ] ,options=t.PARSE_DETAILED_PROCESSING_RECORD | t.PARSE_PRECOMPILED_PREAMBLE) cursor = tu.cursor z = get_cursor(cursor,'TESTB') fid = open('blah.c') raw = fid.read() fid.close() print raw[z.extent.start.offset:z.extent.end.offset] this outputs...
2013 Dec 11
0
[LLVMdev] libcang python bindings and working with macros question
...for cursor in children: if cursor.spelling == spelling: return cursor if cursor.displayname == spelling: return cursor """ import scripts.clang.cindex as cindex from scripts.util import get_cursor index = cindex.Index.create() t = cindex.TranslationUnit tu = index.parse('blah.c',[ ] ,options=t.PARSE_DETAILED_PROCESSING_RECORD | t.PARSE_PRECOMPILED_PREAMBLE) cursor = tu.cursor z = get_cursor(cursor,'TESTB') fid = open('blah.c') raw = fid.read() fid.close() print raw[z.extent.start.offset:z.extent.end.offset] this outputs...
2013 Dec 12
0
[LLVMdev] [libclang] Python bindings bug.
I noticed that the tokens returned from a cursor pointing to a macro change if there is a typedef following a macro. How do I go about submiting a bug against this? import clang.cindex as cindex from clang.util import get_cursor,get_cursors t = cindex.TranslationUnit options=t.PARSE_DETAILED_PROCESSING_RECORD | t.PARSE_PRECOMPILED_PREAMBLE src1 =""" #define TEST 5 """ tu = t.from_source('t.c',"",unsaved_files=[('t.c',src1)],options=options) cursor = get_cursor(tu.cursor,'TEST') tokens = list(curs...
2016 Mar 30
1
[cfe-dev] [PATCH/DRAFT] Embed metadata into object file
...smuggle some > metadata on the module level, from the frontend to the generated object > file (in an hopefully sane and reusable manner). > > So, the solution I thought about was the following. The gathered > information is but into a NamedMetadataStringAttr and attached to the > TranslationUnitDecl. This would be, as far as I can see, the first > annotation on the TranslationUnit level. Attributes seem to me the best > solution at that point, since there is already a good infrastructure in > clang. > > TranslationUnitDecl > | NamedMetadataAttr implicit llvm.extra_se...