[llvm] [llvm][IR] Add per-global code model attribute (PR #72077)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 19:27:26 PST 2023


================
@@ -263,6 +265,16 @@ void GlobalObject::setSection(StringRef S) {
   setGlobalObjectFlag(HasSectionHashEntryBit, !S.empty());
 }
 
+void GlobalObject::setCodeModel(CodeModel::Model M) {
+  getContext().pImpl->GlobalObjectCodeModels[this] = M;
----------------
aeubanks wrote:

we have enough bits to store the code model directly in the SubclassData, let's do that for now for simplicity. we can add a note that if we ever run out of bits we can do this way of storing the actual value in LLVMContextImpl

https://github.com/llvm/llvm-project/pull/72077


More information about the llvm-commits mailing list