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

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 15:36:45 PST 2023


================
@@ -3647,6 +3647,27 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
     printEscapedString(GV->getPartition(), Out);
     Out << '"';
   }
+  if (auto CM = GV->getCodeModel()) {
+    Out << ", code_model \"";
+    switch (*CM) {
+    case CodeModel::Tiny:
+      printEscapedString("tiny", Out);
----------------
aeubanks wrote:

no need to escape, just directly `OS << "tiny";`

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


More information about the llvm-commits mailing list