[PATCH] D33721: [ARM] Add support for target("arm") and target("thumb").

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 2 03:19:42 PDT 2017


fhahn added inline comments.


================
Comment at: lib/Basic/Targets.cpp:5439-5442
+    // [-|+]thumb-mode target features respectively.
+    std::vector<std::string> UpdatedFeaturesVec(FeaturesVec);
+    for (auto &Feature : UpdatedFeaturesVec) {
+      if (Feature.compare("+arm") == 0)
----------------
echristo wrote:
> Won't work below in handleTargetFeatures?
Unfortunately I don't think so, as it seems like `handleTargetFeatures` is only called once in `TargetInfo::CreateTargetInfo` (https://github.com/llvm-mirror/clang/blob/master/lib/Basic/Targets.cpp#L9679
), while `initFeatureMap` is called for each function and thus can be used to modify the user provided `target-features` for individual functions (
https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CodeGenModule.cpp#L4426)  


https://reviews.llvm.org/D33721





More information about the cfe-commits mailing list