[cfe-commits] r155436 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Bill Wendling
isanbard at gmail.com
Tue Apr 24 04:04:57 PDT 2012
Author: void
Date: Tue Apr 24 06:04:57 2012
New Revision: 155436
URL: http://llvm.org/viewvc/llvm-project?rev=155436&view=rev
Log:
Add a flag to the image info section indicating that the program is compiled for
a simulator.
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=155436&r1=155435&r2=155436&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Tue Apr 24 06:04:57 2012
@@ -3612,7 +3612,8 @@
// 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 @@
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 {
More information about the cfe-commits
mailing list