diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-06-04 02:07:14 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-06-04 02:07:14 +0000 |
commit | 5d041beb4e86787b55236d9cf3259fef17423323 (patch) | |
tree | 46144479da4a0e132dce4655e9335e23b482dd0d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 60c4118c88d27b67235ecf3994560bc784f9150e (diff) | |
download | bcm5719-llvm-5d041beb4e86787b55236d9cf3259fef17423323.tar.gz bcm5719-llvm-5d041beb4e86787b55236d9cf3259fef17423323.zip |
Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.
llvm-svn: 183178
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 7ad08e0e0a7..3675e849aa7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -773,6 +773,13 @@ void CodeGenModule::AppendLinkerOptions(StringRef Opts) { LinkerOptionsMetadata.push_back(llvm::MDNode::get(getLLVMContext(), MDOpts)); } +void CodeGenModule::AddDetectMismatch(StringRef Name, StringRef Value) { + llvm::SmallString<32> Opt; + getTargetCodeGenInfo().getDetectMismatchOption(Name, Value, Opt); + llvm::Value *MDOpts = llvm::MDString::get(getLLVMContext(), Opt); + LinkerOptionsMetadata.push_back(llvm::MDNode::get(getLLVMContext(), MDOpts)); +} + void CodeGenModule::AddDependentLib(StringRef Lib) { llvm::SmallString<24> Opt; getTargetCodeGenInfo().getDependentLibraryOption(Lib, Opt); |