[PATCH] D37656: [cfi] Set function attributes for __cfi_* functions.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 17:36:41 PDT 2017


echristo added inline comments.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2917
+                                CodeGenFunction &CGF, llvm::Function *F,
+                                bool ForceThumb) {
+  StringRef TargetCPU = CGF.getTarget().getTargetOpts().CPU;
----------------
I don't think we should be force setting thumb anywhere, it should be handled on a function by function basis the way we do all of the target attribute stuff.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2926-2935
+  Features.reserve(DefaultFeatures.size() + ForceThumb);
+  if (ForceThumb && (Triple.isARM() || Triple.isThumb())) {
+    for (auto &S : DefaultFeatures)
+      if (S != "-thumb-mode" && S != "+thumb-mode")
+        Features.push_back(S);
+    Features.push_back("+thumb-mode");
+  } else {
----------------
All of this should be handled in lib/Basic/Targets/ARM.cpp ARMTargetInfo::initFeatureMap ?


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2961-2963
+  // attributes as SetLLVMFunctionAttributes sets. In particular, __cfi_check
+  // must use the default calling convention for the platform. ABI-changing
+  // flags like -mhard-float should not affect __cfi_check.
----------------
This is odd. Can you explain this a bit more?


https://reviews.llvm.org/D37656





More information about the llvm-commits mailing list