Commits

Mark Lacey committed d69b3052008
Generate IR for inline functions from Clang modules. Currently only inline functions referenced from Swift source files, or from the REPL, will get IR generated for them. Inline functions referenced by other inline functions will require additional effort to generate properly. With this change we use the clang::CodeGenerator-created llvm::Module for all IR generation in Swift. This is perhaps undesirable, but unavoidable given the interface the public Clang APIs expose, which do not allow for building a ModuleBuilder that borrows an existing llvm::Module. Also unfortunate is the hack to generate a UsedAttr for each imported inline function, but the public Clang APIs do not provide a way to only emit deferred decls without emitting other things (e.g. module flags that conflict with what the Swift IRGen emits). Note that we do not do IRGen for every inline function in the module - only the ones that the importer pulls in, which appears to be only those transitively referenced from Swift code. Swift SVN r13134