[PATCH] D52323: Add necessary support for storing code-model to module IR.

Caroline Tice via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 09:33:40 PDT 2018


cmtice marked an inline comment as done.
cmtice added inline comments.


================
Comment at: lib/CodeGen/CodeGenModule.cpp:569
+                  .Default(~0u);
+    if ((CM != ~0u) && (CM != ~1u)) {
+      llvm::CodeModel::Model codeModel = static_cast<llvm::CodeModel::Model>(CM);
----------------
tejohnson wrote:
> Can you simplify by using a single constant for both of these (since handling the same)?
I just realized .Case("default") is not a valid case, so I will remove that and there will only be 1 constant.


================
Comment at: test/CodeGen/codemodels.c:2
+// RUN: %clang_cc1 -emit-llvm  %s -o - | FileCheck %s -check-prefix=CHECK-NOMODEL
+// RUN: %clang_cc1 -emit-llvm -mcode-model small %s -o - | FileCheck %s -check-prefix=CHECK-SMALL
+// RUN: %clang_cc1 -emit-llvm -mcode-model kernel %s -o - | FileCheck %s -check-prefix=CHECK-KERNEL
----------------
tejohnson wrote:
> Might as well check "tiny" and "default" as well for completeness.
I will add a check for "tiny".  "default" turns out not to be a valid option.


Repository:
  rC Clang

https://reviews.llvm.org/D52323





More information about the cfe-commits mailing list