llvm

How to deallocate llvm::module

ぐ巨炮叔叔 提交于 2020-01-14 03:10:12
问题 I have a small language parser that uses LLVM to generate and run code, based on the Kaleidoscope tutorial. My constraint is that I have to recreate the module because I need to process the same input file multiple times, and after the first compilation, LLVM would complain about the module already containing functions, x, etc. The only way forward I see is to recreate the module in between, and this means that I have to recreate ExecutionEngine as well. However, there are a huge amount of

How to deallocate llvm::module

两盒软妹~` 提交于 2020-01-14 03:10:08
问题 I have a small language parser that uses LLVM to generate and run code, based on the Kaleidoscope tutorial. My constraint is that I have to recreate the module because I need to process the same input file multiple times, and after the first compilation, LLVM would complain about the module already containing functions, x, etc. The only way forward I see is to recreate the module in between, and this means that I have to recreate ExecutionEngine as well. However, there are a huge amount of

Can llvm lli excute swift ir

断了今生、忘了曾经 提交于 2020-01-14 02:58:07
问题 I have a function (written in Swift) and I would like to get the LLVM IR for the function PLUS any dependencies so that I can run the resulting LLVM IR in a fully self-contained environment. As an example, consider the following function: func plus(a: Int, b: Int) ->Int { return a + b } plus(5, 7) I can pass the emit-ir option to swiftc , however, the resulting LLVM IR contains external calls and the resulting IR cannot be run using lli (the error is shown below). LLVM ERROR: Program used

FOSDEM 2019 LLVM developer room report

ⅰ亾dé卋堺 提交于 2020-01-13 17:15:06
FOSDEM 2019 LLVM developer room report As well as at the LLVM developer meetings, the LLVM community is also present at a number of other events. One of those is FOSDEM, which has had a dedicated LLVM track since 2014. Earlier this February, the LLVM dev room was back for the 6th time. FOSDEM is one of the largest open source conferences, attracting over 8000 developers attending over 30 parallel tracks, occupying almost all space of the ULB university campus in Brussels. In comparison to the LLVM developer meetings, this dev room offers more of an opportunity to meet up with developers from a

LLVM String Value objects: How can I retrieve the String from a Value?

笑着哭i 提交于 2020-01-12 14:21:10
问题 When building the IR from an existing AST, my AST has some string values (at compile-time they are built from std::string ) and I want to set them safely as llvm::Value to use as a part of an expression. In this case, I don't need to bind the string at run-time, because string values are only meant to resolve stuff as variables, functions or classes at compile-time (the language doesn't support a native string type). Whats the best way to keep my string content as llvm::Value and still be

Xcode 4 automatically generates iVars when using @property,where can I find the official doc for this feature?

我的梦境 提交于 2020-01-12 06:18:11
问题 I have read "What's new in Xcode",but I can't find the official explanation for this feature. Where can I find the official explanation? Which documentation? Thanks. 回答1: You can find this in the Apple documentation in Objective-C Programming Language: Declared Properties under "Property Implementation Directives". Whether or not an ivar is synthesized automatically depends on what runtime you are using: There are differences in the behavior of accessor synthesis that depend on the runtime

Xcode 4 automatically generates iVars when using @property,where can I find the official doc for this feature?

别等时光非礼了梦想. 提交于 2020-01-12 06:18:07
问题 I have read "What's new in Xcode",but I can't find the official explanation for this feature. Where can I find the official explanation? Which documentation? Thanks. 回答1: You can find this in the Apple documentation in Objective-C Programming Language: Declared Properties under "Property Implementation Directives". Whether or not an ivar is synthesized automatically depends on what runtime you are using: There are differences in the behavior of accessor synthesis that depend on the runtime

__attribute__ ((deprecated)) does not work on objective-c protocol methods?

℡╲_俬逩灬. 提交于 2020-01-12 03:21:09
问题 I need to deprecate a single method in objective-c protocol. On normal class/instance methods I add __attribute__ ((deprecated)); after declaration. It seems, that it does not work on protocol methods. If I mark them deprecated and use them somewhere the project compiles OK, without expected deprecation warning. Is it a flaw in Apple LLVM 3.1, or am I doing something wrong? 回答1: Although the answers here provide some very good information, they are outdated. Starting with Xcode 5.0 and LLVM 5

How to attach metadata to LLVM IR using the C++ API?

江枫思渺然 提交于 2020-01-11 10:43:53
问题 Can anyone point me to a concrete example of attaching metadata to llvm-ir using the c++ api? I've read this page http://llvm.org/docs/SourceLevelDebugging.html. Thanks 回答1: The above answer is not quite correct (or complete). You can also create metadata at the module level with just MDNode::get(...) which takes a context and an array of values to create metadata from. Named metadata is very heavyweight and you should only use it as an anchor for top level metadata values. For attaching to

Why an ELF executable could have 4 LOAD segments?

痴心易碎 提交于 2020-01-11 09:55:30
问题 There is a remote 64-bit *nix server that can compile a user-provided code (which should be written in Rust, but I don't think it matters since it uses LLVM). I don't know which compiler/linker flags it uses, but the compiled ELF executable looks weird - it has 4 LOAD segments: $ readelf -e executable ... Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align ... LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000004138 0x0000000000004138 R 0x1000