Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/Basic/TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) {
bool TargetInfo::initFeatureMap(
llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
const std::vector<std::string> &FeatureVec) const {
for (const auto &F : FeatureVec) {
StringRef Name = F;
for (StringRef Name : FeatureVec) {
if (Name.empty())
continue;
// Apply the feature via the target.
Expand Down
6 changes: 2 additions & 4 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3232,17 +3232,15 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) {
if (ParsedAttrs.Duplicate != "")
return Diag(LiteralLoc, diag::err_duplicate_target_attribute)
<< Duplicate << None << ParsedAttrs.Duplicate << Target;
for (const auto &Feature : ParsedAttrs.Features) {
StringRef CurFeature = Feature;
for (StringRef CurFeature : ParsedAttrs.Features) {
if (!CurFeature.starts_with('+') && !CurFeature.starts_with('-'))
return Diag(LiteralLoc, diag::warn_unsupported_target_attribute)
<< Unsupported << None << AttrStr << Target;
}
}

if (Context.getTargetInfo().getTriple().isLoongArch()) {
for (const auto &Feature : ParsedAttrs.Features) {
StringRef CurFeature = Feature;
for (StringRef CurFeature : ParsedAttrs.Features) {
if (CurFeature.starts_with("!arch=")) {
StringRef ArchValue = CurFeature.split("=").second.trim();
return Diag(LiteralLoc, diag::err_attribute_unsupported)
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Tooling/ArgumentsAdjusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ namespace clang {
namespace tooling {

static StringRef getDriverMode(const CommandLineArguments &Args) {
for (const auto &Arg : Args) {
StringRef ArgRef = Arg;
for (StringRef ArgRef : Args) {
if (ArgRef.consume_front("--driver-mode=")) {
return ArgRef;
}
Expand Down
Loading