Skip to content

Commit db000cf

Browse files
committed
[clang][CodeGen][AVR] Fix a crash in AVRABIInfo
fixes #131967
1 parent 163c73d commit db000cf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

clang/lib/CodeGen/Targets/AVR.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ class AVRTargetCodeGenInfo : public TargetCodeGenInfo {
135135
if (GV->isDeclaration())
136136
return;
137137
const auto *FD = dyn_cast_or_null<FunctionDecl>(D);
138-
if (!FD)
139-
return;
138+
if (!FD) return;
140139
auto *Fn = cast<llvm::Function>(GV);
141140

142141
if (FD->getAttr<AVRInterruptAttr>())
@@ -146,7 +145,7 @@ class AVRTargetCodeGenInfo : public TargetCodeGenInfo {
146145
Fn->addFnAttr("signal");
147146
}
148147
};
149-
} // namespace
148+
}
150149

151150
std::unique_ptr<TargetCodeGenInfo>
152151
CodeGen::createAVRTargetCodeGenInfo(CodeGenModule &CGM, unsigned NPR,

clang/test/CodeGen/avr/argument.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ struct s8_t {
119119
char a;
120120
};
121121

122-
// AVR-NOT: {{.*}} signext
123-
// TINY-NOT: {{.*}} signext
122+
// AVR: define {{.*}} i8 @foob(i8 {{.*}})
123+
// TINY define {{.*}} i8 @foob(i8 {{.*}})
124124
char foob(struct s8_t a) {
125125
return a.a + 1;
126126
}

0 commit comments

Comments
 (0)