summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-04-24 11:04:57 +0000
committerBill Wendling <isanbard@gmail.com>2012-04-24 11:04:57 +0000
commit1e60a2c287deeff8738b5078a753d1c1d69cf7f0 (patch)
tree2d7d981453e4ad9fe283bc734a5b4c57b79c9850 /clang/lib/CodeGen
parentf1b14b719f3a51b062a4d28f8309f8dfb69427e4 (diff)
downloadbcm5719-llvm-1e60a2c287deeff8738b5078a753d1c1d69cf7f0.tar.gz
bcm5719-llvm-1e60a2c287deeff8738b5078a753d1c1d69cf7f0.zip
Add a flag to the image info section indicating that the program is compiled for
a simulator. llvm-svn: 155436
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index e5246f101f9..7796f92aff6 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -3612,7 +3612,8 @@ enum ImageInfoFlags {
// A flag indicating that the module has no instances of a @synthesize of a
// superclass variable. <rdar://problem/6803242>
- eImageInfo_CorrectedSynthesize = (1 << 4)
+ eImageInfo_CorrectedSynthesize = (1 << 4),
+ eImageInfo_ImageIsSimulated = (1 << 5)
};
void CGObjCCommonMac::EmitImageInfo() {
@@ -3657,6 +3658,14 @@ void CGObjCCommonMac::EmitImageInfo() {
llvm::MDNode::get(VMContext, Ops));
}
}
+
+ // Indicate whether we're compiling this to run on a simulator.
+ const llvm::Triple &Triple = CGM.getTarget().getTriple();
+ if (Triple.getOS() == llvm::Triple::IOS &&
+ (Triple.getArch() == llvm::Triple::x86 ||
+ Triple.getArch() == llvm::Triple::x86_64))
+ Mod.addModuleFlag(llvm::Module::Error, "Objective-C Is Simulated",
+ eImageInfo_ImageIsSimulated);
}
// struct objc_module {
OpenPOWER on IntegriCloud