Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: lib/Basic/Targets.cpp

Issue 1323073010: Use LLVM args to handle -malign-double option (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Review feedback addressed Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/clang/Driver/Options.td ('k') | lib/Frontend/CompilerInvocation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Basic/Targets.cpp
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 4cfd0cf62bb27ba115ca7ef0efd7e28cfe625760..d34bcfebdfe0f57f5a3746f824c9cf1c4116b369 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -3520,19 +3520,16 @@ public:
return X86TargetInfo::validateOperandSize(Constraint, Size);
}
+
// @LOCALMOD-START
- bool handleTargetFeatures(std::vector<std::string> &Features,
- DiagnosticsEngine &Diags) override {
+ bool handleLLVMArgs(std::vector<std::string> &Args) override {
HasAlignedDouble = false;
- auto it = std::find(Features.begin(), Features.end(), "+align-double");
- if (it != Features.end()) {
+ auto it = std::find(Args.begin(), Args.end(), "-malign-double");
+ if (it != Args.end()) {
HasAlignedDouble = true;
- Features.erase(it);
}
-
setDescriptionString();
-
- return X86TargetInfo::handleTargetFeatures(Features, Diags);
+ return true;
}
// @LOCALMOD-END
};
@@ -7305,5 +7302,10 @@ TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags,
if (!Target->handleTargetFeatures(Opts->Features, Diags))
return nullptr;
+ // @LOCALMOD-START
+ if (!Target->handleLLVMArgs(Opts->LLVMArgs))
+ return nullptr;
+ // @LOCALMOD-END
+
return Target.release();
}
« no previous file with comments | « include/clang/Driver/Options.td ('k') | lib/Frontend/CompilerInvocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698