diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticFrontendKinds.td | 2 | ||||
-rw-r--r-- | include/clang/CodeGen/CodeGenAction.h | 6 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 2 | ||||
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index 82f91961e7..c9f5a5c486 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -19,6 +19,8 @@ def err_fe_invalid_ast_action : Error<"invalid action for AST input">, // Error generated by the backend. def err_fe_inline_asm : Error<"%0">, CatInlineAsm; def note_fe_inline_asm_here : Note<"instantiated into assembly here">; +def err_fe_cannot_link_module : Error<"cannot link module '%0': %1">, + DefaultFatal; diff --git a/include/clang/CodeGen/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h index f1a2f6eb45..9697bc62af 100644 --- a/include/clang/CodeGen/CodeGenAction.h +++ b/include/clang/CodeGen/CodeGenAction.h @@ -25,6 +25,7 @@ class CodeGenAction : public ASTFrontendAction { private: unsigned Act; llvm::OwningPtr<llvm::Module> TheModule; + llvm::Module *LinkModule; llvm::LLVMContext *VMContext; bool OwnsVMContext; @@ -46,6 +47,11 @@ protected: public: ~CodeGenAction(); + /// setLinkModule - Set the link module to be used by this action. If a link + /// module is not provided, and CodeGenOptions::LinkBitcodeFile is non-empty, + /// the action will load it from the specified file. + void setLinkModule(llvm::Module *Mod) { LinkModule = Mod; } + /// takeModule - Take the generated LLVM module, for use after the action has /// been run. The result may be null on failure. llvm::Module *takeModule(); diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index c5d232abf6..1a6008e779 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -196,6 +196,8 @@ def mms_bitfields : Flag<"-mms-bitfields">, HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">; def mstackrealign : Flag<"-mstackrealign">, HelpText<"Force realign the stack at entry to every function.">; +def mlink_bitcode_file : Separate<"-mlink-bitcode-file">, + HelpText<"Link the given bitcode file before performing optimizations.">; def O : Joined<"-O">, HelpText<"Optimization level">; def Os : Flag<"-Os">, HelpText<"Optimize for size">; def Oz : Flag<"-Oz">, HelpText<"Optimize for size, regardless of performance">; diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 5b698889f6..9962ea8cf9 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -128,6 +128,9 @@ public: /// The float precision limit to use, if non-empty. std::string LimitFloatPrecision; + /// The name of the bitcode file to link before optzns. + std::string LinkBitcodeFile; + /// The kind of inlining to perform. InliningMethod Inlining; |