Skip to content

Commit

Permalink
Merge from 'main' to 'sycl-web' (70 commits)
Browse files Browse the repository at this point in the history
  CONFLICT (content): Merge conflict in clang/include/clang/Basic/AttributeCommonInfo.h
  CONFLICT (content): Merge conflict in clang/lib/Basic/Attributes.cpp
  CONFLICT (content): Merge conflict in clang/utils/TableGen/TableGen.cpp
  • Loading branch information
mdfazlay committed Jan 24, 2025
2 parents 76271f1 + 4018317 commit 915f3ed
Show file tree
Hide file tree
Showing 329 changed files with 25,676 additions and 22,937 deletions.
8 changes: 4 additions & 4 deletions clang-tools-extra/modularize/CoverageChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ CoverageChecker::collectUmbrellaHeaderHeaders(StringRef UmbrellaHeaderName) {
sys::fs::current_path(PathBuf);

// Create the compilation database.
std::unique_ptr<CompilationDatabase> Compilations;
Compilations.reset(new FixedCompilationDatabase(Twine(PathBuf), CommandLine));
FixedCompilationDatabase Compilations(Twine(PathBuf), CommandLine);

std::vector<std::string> HeaderPath;
HeaderPath.push_back(std::string(UmbrellaHeaderName));

// Create the tool and run the compilation.
ClangTool Tool(*Compilations, HeaderPath);
int HadErrors = Tool.run(new CoverageCheckerFrontendActionFactory(*this));
ClangTool Tool(Compilations, HeaderPath);
CoverageCheckerFrontendActionFactory ActionFactory(*this);
int HadErrors = Tool.run(&ActionFactory);

// If we had errors, exit early.
return !HadErrors;
Expand Down
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ Improvements to Clang's diagnostics

- Clang now emits a ``-Wignored-qualifiers`` diagnostic when a base class includes cv-qualifiers (#GH55474).

- Clang now diagnoses the use of attribute names reserved by the C++ standard (#GH92196).

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

Expand Down
9 changes: 8 additions & 1 deletion clang/include/clang/Basic/AttributeCommonInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AttributeCommonInfo {
};
enum Kind {
#define PARSED_ATTR(NAME) AT_##NAME,
#include "clang/Sema/AttrParsedAttrList.inc"
#include "clang/Basic/AttrParsedAttrList.inc"
#undef PARSED_ATTR
NoSemaHandlerAttribute,
IgnoredAttribute,
Expand All @@ -81,6 +81,11 @@ class AttributeCommonInfo {
CL,
SYCL_DETAIL
};
enum class AttrArgsInfo {
None,
Optional,
Required,
};

private:
const IdentifierInfo *AttrName = nullptr;
Expand Down Expand Up @@ -254,6 +259,8 @@ class AttributeCommonInfo {
static Kind getParsedKind(const IdentifierInfo *Name,
const IdentifierInfo *Scope, Syntax SyntaxUsed);

static AttrArgsInfo getCXX11AttrArgsInfo(const IdentifierInfo *Name);

private:
/// Get an index into the attribute spelling list
/// defined in Attr.td. This index is used by an attribute
Expand Down
5 changes: 5 additions & 0 deletions clang/include/clang/Basic/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ int hasAttribute(AttributeCommonInfo::Syntax Syntax,
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
const TargetInfo &Target, const LangOptions &LangOpts);

int hasAttribute(AttributeCommonInfo::Syntax Syntax,
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
const TargetInfo &Target, const LangOptions &LangOpts,
bool CheckPlugins);

} // end namespace clang

#endif // LLVM_CLANG_BASIC_ATTRIBUTES_H
48 changes: 24 additions & 24 deletions clang/include/clang/Basic/BuiltinsX86.td
Original file line number Diff line number Diff line change
Expand Up @@ -5191,51 +5191,51 @@ let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] i
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtne2ph2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
def vcvt2ph2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtne2ph2bf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
def vcvt2ph2bf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtne2ph2bf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
def vcvt2ph2bf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtne2ph2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
def vcvt2ph2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtne2ph2bf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
def vcvt2ph2bf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtne2ph2bf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
def vcvt2ph2bf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtne2ph2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
def vcvt2ph2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtne2ph2hf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
def vcvt2ph2hf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtne2ph2hf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
def vcvt2ph2hf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtne2ph2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
def vcvt2ph2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtne2ph2hf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
def vcvt2ph2hf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtne2ph2hf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
def vcvt2ph2hf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
Expand All @@ -5251,51 +5251,51 @@ let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] i
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtneph2bf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
def vcvtph2bf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtneph2bf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
def vcvtph2bf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtneph2bf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
def vcvtph2bf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtneph2bf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
def vcvtph2bf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtneph2bf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
def vcvtph2bf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtneph2bf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
def vcvtph2bf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtneph2hf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
def vcvtph2hf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtneph2hf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
def vcvtph2hf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtneph2hf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
def vcvtph2hf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
def vcvtneph2hf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
def vcvtph2hf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
def vcvtneph2hf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
def vcvtph2hf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
}

let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
def vcvtneph2hf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
def vcvtph2hf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
}

let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
Expand Down
11 changes: 11 additions & 0 deletions clang/include/clang/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ clang_tablegen(AttrList.inc -gen-clang-attr-list
SOURCE Attr.td
TARGET ClangAttrList)

clang_tablegen(AttrParsedAttrList.inc -gen-clang-attr-parsed-attr-list
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
SOURCE Attr.td
TARGET ClangAttrParsedAttrList)

clang_tablegen(AttrSubMatchRulesList.inc -gen-clang-attr-subject-match-rule-list
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
SOURCE Attr.td
Expand All @@ -53,6 +58,12 @@ clang_tablegen(AttrHasAttributeImpl.inc -gen-clang-attr-has-attribute-impl
TARGET ClangAttrHasAttributeImpl
)

clang_tablegen(CXX11AttributeInfo.inc -gen-cxx11-attribute-info
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
SOURCE Attr.td
TARGET CXX11AttributeInfo
)

clang_tablegen(Builtins.inc -gen-clang-builtins
SOURCE Builtins.td
TARGET ClangBuiltins)
Expand Down
4 changes: 3 additions & 1 deletion clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
def KeywordAsMacro : DiagGroup<"keyword-macro">;
def ReservedIdAsMacro : DiagGroup<"reserved-macro-identifier">;
def ReservedIdAsMacroAlias : DiagGroup<"reserved-id-macro", [ReservedIdAsMacro]>;
def ReservedAttributeIdentifier : DiagGroup<"reserved-attribute-identifier">;
def RestrictExpansionMacro : DiagGroup<"restrict-expansion">;
def FinalMacro : DiagGroup<"final-macro">;

Expand Down Expand Up @@ -945,7 +946,8 @@ def SignedEnumBitfield : DiagGroup<"signed-enum-bitfield">;

def ReservedModuleIdentifier : DiagGroup<"reserved-module-identifier">;
def ReservedIdentifier : DiagGroup<"reserved-identifier",
[ReservedIdAsMacro, ReservedModuleIdentifier, UserDefinedLiterals]>;
[ReservedIdAsMacro, ReservedModuleIdentifier,
UserDefinedLiterals, ReservedAttributeIdentifier]>;

// Unreachable code warning groups.
//
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticLexKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ def warn_pp_macro_hides_keyword : Extension<
def warn_pp_macro_is_reserved_id : Warning<
"macro name is a reserved identifier">, DefaultIgnore,
InGroup<ReservedIdAsMacro>;
def warn_pp_macro_is_reserved_attribute_id : Warning<
"%0 is a reserved attribute identifier">, DefaultIgnore,
InGroup<ReservedAttributeIdentifier>;
def warn_pp_objc_macro_redef_ignored : Warning<
"ignoring redefinition of Objective-C qualifier macro">,
InGroup<DiagGroup<"objc-macro-redefinition">>;
Expand Down
10 changes: 5 additions & 5 deletions clang/include/clang/Lex/Preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,11 @@ class Preprocessor {
}
}

/// Determine whether the next preprocessor token to be
/// lexed is a '('. If so, consume the token and return true, if not, this
/// method should have no observable side-effect on the lexed tokens.
bool isNextPPTokenLParen();

private:
/// Identifiers used for SEH handling in Borland. These are only
/// allowed in particular circumstances
Expand Down Expand Up @@ -2649,11 +2654,6 @@ class Preprocessor {

void removeCachedMacroExpandedTokensOfLastLexer();

/// Determine whether the next preprocessor token to be
/// lexed is a '('. If so, consume the token and return true, if not, this
/// method should have no observable side-effect on the lexed tokens.
bool isNextPPTokenLParen();

/// After reading "MACRO(", this method is invoked to read all of the formal
/// arguments specified for the macro invocation. Returns null on error.
MacroArgs *ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI,
Expand Down
5 changes: 0 additions & 5 deletions clang/include/clang/Sema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ clang_tablegen(AttrTemplateInstantiate.inc -gen-clang-attr-template-instantiate
SOURCE ../Basic/Attr.td
TARGET ClangAttrTemplateInstantiate)

clang_tablegen(AttrParsedAttrList.inc -gen-clang-attr-parsed-attr-list
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
SOURCE ../Basic/Attr.td
TARGET ClangAttrParsedAttrList)

clang_tablegen(AttrParsedAttrKinds.inc -gen-clang-attr-parsed-attr-kinds
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
SOURCE ../Basic/Attr.td
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/AST/JSONNodeDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1540,9 +1540,9 @@ void JSONNodeDumper::VisitExprWithCleanups(const ExprWithCleanups *EWC) {
if (EWC->getNumObjects()) {
JOS.attributeArray("cleanups", [this, EWC] {
for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
if (auto *BD = CO.dyn_cast<BlockDecl *>()) {
if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
JOS.value(createBareDeclRef(BD));
} else if (auto *CLE = CO.dyn_cast<CompoundLiteralExpr *>()) {
} else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
llvm::json::Object Obj;
Obj["id"] = createPointerRepresentation(CLE);
Obj["kind"] = CLE->getStmtClassName();
Expand Down
35 changes: 28 additions & 7 deletions clang/lib/Basic/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
return 0;
}

int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax, const IdentifierInfo *Scope,
const IdentifierInfo *Attr, const TargetInfo &Target,
const LangOptions &LangOpts) {
int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
const TargetInfo &Target, const LangOptions &LangOpts,
bool CheckPlugins) {
StringRef ScopeName = Scope ? Scope->getName() : "";
StringRef Name = Attr->getName();
// Normalize the attribute name, __foo__ becomes foo.
Expand Down Expand Up @@ -65,14 +66,23 @@ int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax, const IdentifierInfo
if (res)
return res;

// Check if any plugin provides this attribute.
for (auto &Ptr : getAttributePluginInstances())
if (Ptr->hasSpelling(Syntax, Name))
return 1;
if (CheckPlugins) {
// Check if any plugin provides this attribute.
for (auto &Ptr : getAttributePluginInstances())
if (Ptr->hasSpelling(Syntax, Name))
return 1;
}

return 0;
}

int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
const TargetInfo &Target, const LangOptions &LangOpts) {
return hasAttribute(Syntax, Scope, Attr, Target, LangOpts,
/*CheckPlugins=*/true);
}

const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) {
switch (Rule) {
#define ATTR_MATCH_RULE(NAME, SPELLING, IsAbstract) \
Expand Down Expand Up @@ -155,6 +165,17 @@ AttributeCommonInfo::getParsedKind(const IdentifierInfo *Name,
return ::getAttrKind(normalizeName(Name, ScopeName, SyntaxUsed), SyntaxUsed);
}

AttributeCommonInfo::AttrArgsInfo
AttributeCommonInfo::getCXX11AttrArgsInfo(const IdentifierInfo *Name) {
StringRef AttrName =
normalizeAttrName(Name, /*NormalizedScopeName*/ "", Syntax::AS_CXX11);
#define CXX11_ATTR_ARGS_INFO
return llvm::StringSwitch<AttributeCommonInfo::AttrArgsInfo>(AttrName)
#include "clang/Basic/CXX11AttributeInfo.inc"
.Default(AttributeCommonInfo::AttrArgsInfo::None);
#undef CXX11_ATTR_ARGS_INFO
}

std::string AttributeCommonInfo::getNormalizedFullName() const {
return static_cast<std::string>(
normalizeName(getAttrName(), getScopeName(), getSyntax()));
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGOpenMPRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4079,7 +4079,7 @@ static void emitDependData(CodeGenFunction &CGF, QualType &KmpDependInfoTy,
Size = llvm::ConstantInt::get(CGF.SizeTy, 0);
}
LValue Base;
if (unsigned *P = Pos.dyn_cast<unsigned *>()) {
if (unsigned *P = dyn_cast<unsigned *>(Pos)) {
Base = CGF.MakeAddrLValue(
CGF.Builder.CreateConstGEP(DependenciesArray, *P), KmpDependInfoTy);
} else {
Expand Down Expand Up @@ -4109,7 +4109,7 @@ static void emitDependData(CodeGenFunction &CGF, QualType &KmpDependInfoTy,
CGF.EmitStoreOfScalar(
llvm::ConstantInt::get(LLVMFlagsTy, static_cast<unsigned int>(DepKind)),
FlagsLVal);
if (unsigned *P = Pos.dyn_cast<unsigned *>()) {
if (unsigned *P = dyn_cast<unsigned *>(Pos)) {
++(*P);
} else {
LValue &PosLVal = *cast<LValue *>(Pos);
Expand Down
5 changes: 2 additions & 3 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6875,9 +6875,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fno-direct-access-external-data");
}

if (Args.hasFlag(options::OPT_fno_plt, options::OPT_fplt, false)) {
CmdArgs.push_back("-fno-plt");
}
if (Triple.isOSBinFormatELF() && (Triple.isAArch64() || Triple.isX86()))
Args.addOptOutFlag(CmdArgs, options::OPT_fplt, options::OPT_fno_plt);

// -fhosted is default.
// TODO: Audit uses of KernelOrKext and see where it'd be more appropriate to
Expand Down
Loading

0 comments on commit 915f3ed

Please sign in to comment.