Skip to content

Commit

Permalink
merge main into amd-staging
Browse files Browse the repository at this point in the history
Change-Id: I583c49d883e7253f246e0737ee2f8ece0d39cfc3
  • Loading branch information
animeshk-amd committed Aug 23, 2024
2 parents 6cc7495 + 15e915a commit a0b23a1
Show file tree
Hide file tree
Showing 269 changed files with 4,687 additions and 2,029 deletions.
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ Improvements to Clang's diagnostics

- Clang now diagnoses when the result of a [[nodiscard]] function is discarded after being cast in C. Fixes #GH104391.

- Don't emit duplicated dangling diagnostics. (#GH93386).

Improvements to Clang's time-trace
----------------------------------

Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -6266,6 +6266,10 @@ def mv8plus : Flag<["-"], "mv8plus">, Group<m_sparc_Features_Group>,
HelpText<"Enable V8+ mode, allowing use of 64-bit V9 instructions in 32-bit code">;
def mno_v8plus : Flag<["-"], "mno-v8plus">, Group<m_sparc_Features_Group>,
HelpText<"Disable V8+ mode">;
def mfix_gr712rc : Flag<["-"], "mfix-gr712rc">, Group<m_sparc_Features_Group>,
HelpText<"Enable workarounds for GR712RC errata">;
def mfix_ut700 : Flag<["-"], "mfix-ut700">, Group<m_sparc_Features_Group>,
HelpText<"Enable workarounds for UT700 errata">;
foreach i = 1 ... 7 in
def ffixed_g#i : Flag<["-"], "ffixed-g"#i>, Group<m_sparc_Features_Group>,
HelpText<"Reserve the G"#i#" register (SPARC only)">;
Expand Down
23 changes: 9 additions & 14 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,15 +1318,6 @@ bool Compiler<Emitter>::VisitArraySubscriptExpr(const ArraySubscriptExpr *E) {
template <class Emitter>
bool Compiler<Emitter>::visitInitList(ArrayRef<const Expr *> Inits,
const Expr *ArrayFiller, const Expr *E) {

QualType QT = E->getType();

if (const auto *AT = QT->getAs<AtomicType>())
QT = AT->getValueType();

if (QT->isVoidType())
return this->emitInvalid(E);

// Handle discarding first.
if (DiscardResult) {
for (const Expr *Init : Inits) {
Expand All @@ -1336,6 +1327,13 @@ bool Compiler<Emitter>::visitInitList(ArrayRef<const Expr *> Inits,
return true;
}

QualType QT = E->getType();
if (const auto *AT = QT->getAs<AtomicType>())
QT = AT->getValueType();

if (QT->isVoidType())
return this->emitInvalid(E);

// Primitive values.
if (std::optional<PrimType> T = classify(QT)) {
assert(!DiscardResult);
Expand Down Expand Up @@ -3251,12 +3249,9 @@ template <class Emitter> bool Compiler<Emitter>::visit(const Expr *E) {
if (E->getType().isNull())
return false;

if (E->getType()->isVoidType())
return this->discard(E);

// Create local variable to hold the return value.
if (!E->isGLValue() && !E->getType()->isAnyComplexType() &&
!classify(E->getType())) {
if (!E->getType()->isVoidType() && !E->isGLValue() &&
!E->getType()->isAnyComplexType() && !classify(E->getType())) {
std::optional<unsigned> LocalIndex = allocateLocal(E);
if (!LocalIndex)
return false;
Expand Down
13 changes: 13 additions & 0 deletions clang/lib/Driver/ToolChains/Arch/Sparc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,17 @@ void sparc::getSparcTargetFeatures(const Driver &D, const ArgList &Args,

if (Args.hasArg(options::OPT_ffixed_i5))
Features.push_back("+reserve-i5");

if (Args.hasArg(options::OPT_mfix_gr712rc)) {
Features.push_back("+fix-tn0009");
Features.push_back("+fix-tn0011");
Features.push_back("+fix-tn0012");
Features.push_back("+fix-tn0013");
}

if (Args.hasArg(options::OPT_mfix_ut700)) {
Features.push_back("+fix-tn0009");
Features.push_back("+fix-tn0010");
Features.push_back("+fix-tn0013");
}
}
Loading

0 comments on commit a0b23a1

Please sign in to comment.