Skip to content

Commit

Permalink
Overwritten with: ad0cb95 Manual merge master:88f722c269a into amd-gfx:
Browse files Browse the repository at this point in the history
Based on upstream llvm : 88f722c [DSE,MSSA] Enable XFAIL'd merge-stores.ll test (NFC).

Local changes since da64bde:
ad0cb95 Manual merge master:88f722c269a into amd-gfx:
30d3325 Merged master:7df80e3f23b into amd-gfx:dad54ad1ea9
dad54ad Merged master:120c0592929 into amd-gfx:6618d614ef1
6618d61 Merged master:e1741e34e00 into amd-gfx:da89f3bc942
da89f3b [AMDGPU] Temporary fix to get previous intrinsic cost
3cebb4d Merged master:ff4c5103376 into amd-gfx:e590dba81bd
e590dba Merged master:1e87261ba17 into amd-gfx:b313f433300
b313f43 Merged master:3dcfd482cb1 into amd-gfx:b927e58a6c3
b927e58 Merged master:2e92b397ae4 into amd-gfx:f982686ca1e
f982686 Merged master:6f0ce46873b into amd-gfx:5615b1ef183
5615b1e Merged master:c966ed8dc7c into amd-gfx:7e2b6a2d3b9
7e2b6a2 Merged master:519b019a0a6 into amd-gfx:f8e6c611a2d
f8e6c61 Merged master:8472ae1773a into amd-gfx:036904c0a38
036904c Merged master:1c03389c29f into amd-gfx:78c4105e266
78c4105 Merged master:6239d670018 into amd-gfx:c08830d801d
c08830d Merged master:59491b208f3 into amd-gfx:66793841c4c
6679384 Merged master:e82eff7a03b into amd-gfx:7708b7d09b3
7708b7d Merged master:2843e7495b7 into amd-gfx:40d760c210d
40d760c Merged master:904f91db5fc into amd-gfx:f5013394bd5
f501339 Merged master:e4184c84ca0 into amd-gfx:054e834e686
054e834 Merged master:0ee47cc92f5 into amd-gfx:7d86b8a1c00
7d86b8a Revert "[AMDGPU] Make SGPR spills exec mask agnostic"
1b3041b Merged master:ceaee253f4f into amd-gfx:0304f564ba2
0304f56 Merged master:938cc573ee1 into amd-gfx:c852aeff68b
c852aef Merged master:01e64c97126 into amd-gfx:8a50ada4530
8a50ada Merged master:d5c28c40943 into amd-gfx:a1b414ebfc7
a1b414e Merged master:de019b88dd5 into amd-gfx:0b6b177d481
0b6b177 Merged master:55c365d247b into amd-gfx:2110e94aa1e
2110e94 Merged master:f22b0727fe7 into amd-gfx:aaef88a2ebd
aaef88a Manually merged master:d8f651d3e8e into amd-gfx:b1b348f5444
b1b348f Merged master:bc2b70982be into amd-gfx:36d6d1e9ba5
36d6d1e Merged master:e3546c78cab into amd-gfx:98a96240c8f
98a9624 Merged master:c9790d54f83 into amd-gfx:e7e884ea599
e7e884e Merged master:7e58d0ded09 into amd-gfx:c20d9f185ac
c20d9f1 Merged master:ba10bedf563 into amd-gfx:ec24565c877
ec24565 Merged master:a92ce3b706d into amd-gfx:67cb9805444
67cb980 Merged master:22c2dc5931a into amd-gfx:4af5d330416
4af5d33 Merged master:936ec89e91e into amd-gfx:120f4a20ffa
120f4a2 Merged master:28ccd09d700 into amd-gfx:4af26405971
4af2640 Merged master:4c50cf91973 into amd-gfx:bd3b822e680
bd3b822 Merged master:9c3909556b3 into amd-gfx:c8494c6314f
c8494c6 Merged master:1778564f911 into amd-gfx:242b037f79c

Added AMD modification notices and removed some GPL files.

Change-Id: I10506cde6c266a959a80608d4d6ecbad6367eb3a
  • Loading branch information
trenouf committed Jun 21, 2020
2 parents da64bde + ad0cb95 commit 7ce7cdb
Show file tree
Hide file tree
Showing 4,218 changed files with 180,966 additions and 64,576 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/GRTAGS
/GSYMS
/GTAGS
/ID
.gitusers
autom4te.cache
cscope.files
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-apply-replacements/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ set(LLVM_LINK_COMPONENTS

add_clang_library(clangApplyReplacements
lib/Tooling/ApplyReplacements.cpp
)

LINK_LIBS
clang_target_link_libraries(clangApplyReplacements
PRIVATE
clangAST
clangBasic
clangRewrite
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-change-namespace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set(LLVM_LINK_COMPONENTS

add_clang_library(clangChangeNamespace
ChangeNamespace.cpp
)

LINK_LIBS
clang_target_link_libraries(clangChangeNamespace
PRIVATE
clangAST
clangASTMatchers
clangBasic
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ add_clang_library(clangDoc
Representation.cpp
Serialize.cpp
YAMLGenerator.cpp
)

LINK_LIBS
clang_target_link_libraries(clangDoc
PRIVATE
clangAnalysis
clangAST
clangASTMatchers
Expand Down
7 changes: 3 additions & 4 deletions clang-tools-extra/clang-doc/Generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ namespace doc {

llvm::Expected<std::unique_ptr<Generator>>
findGeneratorByName(llvm::StringRef Format) {
for (auto I = GeneratorRegistry::begin(), E = GeneratorRegistry::end();
I != E; ++I) {
if (I->getName() != Format)
for (const auto &Generator : GeneratorRegistry::entries()) {
if (Generator.getName() != Format)
continue;
return I->instantiate();
return Generator.instantiate();
}
return createStringError(llvm::inconvertibleErrorCode(),
"can't find generator: " + Format);
Expand Down
6 changes: 5 additions & 1 deletion clang-tools-extra/clang-include-fixer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ add_clang_library(clangIncludeFixer
YamlSymbolIndex.cpp

LINK_LIBS
findAllSymbols
)

clang_target_link_libraries(clangIncludeFixer
PRIVATE
clangAST
clangBasic
clangFormat
Expand All @@ -21,7 +26,6 @@ add_clang_library(clangIncludeFixer
clangSerialization
clangTooling
clangToolingCore
findAllSymbols
)

add_subdirectory(plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ add_clang_library(findAllSymbols
PragmaCommentHandler.cpp
STLPostfixHeaderMap.cpp
SymbolInfo.cpp
)

LINK_LIBS
clang_target_link_libraries(findAllSymbols
PRIVATE
clangAST
clangASTMatchers
clangBasic
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-move/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set(LLVM_LINK_COMPONENTS
add_clang_library(clangMove
Move.cpp
HelperDeclRefGraph.cpp
)

LINK_LIBS
clang_target_link_libraries(clangMove
PRIVATE
clangAnalysis
clangAST
clangASTMatchers
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-query/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ set(LLVM_LINK_COMPONENTS
add_clang_library(clangQuery
Query.cpp
QueryParser.cpp
)

LINK_LIBS
clang_target_link_libraries(clangQuery
PRIVATE
clangAST
clangASTMatchers
clangBasic
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clang-reorder-fields/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set(LLVM_LINK_COMPONENTS

add_clang_library(clangReorderFields
ReorderFieldsAction.cpp
)

LINK_LIBS
clang_target_link_libraries(clangReorderFields
PRIVATE
clangAST
clangASTMatchers
clangBasic
Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ add_clang_library(clangTidy

DEPENDS
ClangSACheckers
)

LINK_LIBS
clang_target_link_libraries(clangTidy
PRIVATE
clangAnalysis
clangAST
clangASTMatchers
Expand All @@ -32,7 +34,8 @@ add_clang_library(clangTidy
)

if(CLANG_ENABLE_STATIC_ANALYZER)
target_link_libraries(clangTidy PRIVATE
clang_target_link_libraries(clangTidy
PRIVATE
clangStaticAnalyzerCore
clangStaticAnalyzerFrontend
)
Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/clang-tidy/ClangTidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class ErrorReporter {
DiagPrinter),
SourceMgr(Diags, Files), Context(Context), ApplyFixes(ApplyFixes),
TotalFixes(0), AppliedFixes(0), WarningsAsErrors(0) {
DiagOpts->ShowColors = llvm::sys::Process::StandardOutHasColors();
DiagOpts->ShowColors = Context.getOptions().UseColor.getValueOr(
llvm::sys::Process::StandardOutHasColors());
DiagPrinter->BeginSourceFile(LangOpts);
}

Expand Down
104 changes: 70 additions & 34 deletions clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ template <> struct MappingTraits<ClangTidyOptions> {
IO.mapOptional("ExtraArgs", Options.ExtraArgs);
IO.mapOptional("ExtraArgsBefore", Options.ExtraArgsBefore);
IO.mapOptional("InheritParentConfig", Options.InheritParentConfig);
IO.mapOptional("UseColor", Options.UseColor);
}
};

Expand All @@ -114,11 +115,10 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
Options.FormatStyle = "none";
Options.User = llvm::None;
unsigned Priority = 0;
for (ClangTidyModuleRegistry::iterator I = ClangTidyModuleRegistry::begin(),
E = ClangTidyModuleRegistry::end();
I != E; ++I)
for (const ClangTidyModuleRegistry::entry &Module :
ClangTidyModuleRegistry::entries())
Options =
Options.mergeWith(I->instantiate()->getModuleOptions(), ++Priority);
Options.mergeWith(Module.instantiate()->getModuleOptions(), ++Priority);
return Options;
}

Expand Down Expand Up @@ -154,6 +154,7 @@ ClangTidyOptions ClangTidyOptions::mergeWith(const ClangTidyOptions &Other,
overrideValue(Result.SystemHeaders, Other.SystemHeaders);
overrideValue(Result.FormatStyle, Other.FormatStyle);
overrideValue(Result.User, Other.User);
overrideValue(Result.UseColor, Other.UseColor);
mergeVectors(Result.ExtraArgs, Other.ExtraArgs);
mergeVectors(Result.ExtraArgsBefore, Other.ExtraArgsBefore);

Expand Down Expand Up @@ -193,22 +194,35 @@ ConfigOptionsProvider::ConfigOptionsProvider(
const ClangTidyGlobalOptions &GlobalOptions,
const ClangTidyOptions &DefaultOptions,
const ClangTidyOptions &ConfigOptions,
const ClangTidyOptions &OverrideOptions)
: DefaultOptionsProvider(GlobalOptions, DefaultOptions),
ConfigOptions(ConfigOptions), OverrideOptions(OverrideOptions) {}
const ClangTidyOptions &OverrideOptions,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
: FileOptionsBaseProvider(GlobalOptions, DefaultOptions, OverrideOptions,
FS),
ConfigOptions(ConfigOptions) {}

std::vector<OptionsSource>
ConfigOptionsProvider::getRawOptions(llvm::StringRef FileName) {
std::vector<OptionsSource> RawOptions =
DefaultOptionsProvider::getRawOptions(FileName);
if (ConfigOptions.InheritParentConfig.getValueOr(false)) {
LLVM_DEBUG(llvm::dbgs()
<< "Getting options for file " << FileName << "...\n");
assert(FS && "FS must be set.");

llvm::SmallString<128> AbsoluteFilePath(FileName);

if (!FS->makeAbsolute(AbsoluteFilePath)) {
addRawFileOptions(AbsoluteFilePath, RawOptions);
}
}
RawOptions.emplace_back(ConfigOptions,
OptionsSourceTypeConfigCommandLineOption);
RawOptions.emplace_back(OverrideOptions,
OptionsSourceTypeCheckCommandLineOption);
return RawOptions;
}

FileOptionsProvider::FileOptionsProvider(
FileOptionsBaseProvider::FileOptionsBaseProvider(
const ClangTidyGlobalOptions &GlobalOptions,
const ClangTidyOptions &DefaultOptions,
const ClangTidyOptions &OverrideOptions,
Expand All @@ -220,36 +234,21 @@ FileOptionsProvider::FileOptionsProvider(
ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
}

FileOptionsProvider::FileOptionsProvider(
FileOptionsBaseProvider::FileOptionsBaseProvider(
const ClangTidyGlobalOptions &GlobalOptions,
const ClangTidyOptions &DefaultOptions,
const ClangTidyOptions &OverrideOptions,
const FileOptionsProvider::ConfigFileHandlers &ConfigHandlers)
const FileOptionsBaseProvider::ConfigFileHandlers &ConfigHandlers)
: DefaultOptionsProvider(GlobalOptions, DefaultOptions),
OverrideOptions(OverrideOptions), ConfigHandlers(ConfigHandlers) {}

// FIXME: This method has some common logic with clang::format::getStyle().
// Consider pulling out common bits to a findParentFileWithName function or
// similar.
std::vector<OptionsSource>
FileOptionsProvider::getRawOptions(StringRef FileName) {
LLVM_DEBUG(llvm::dbgs() << "Getting options for file " << FileName
<< "...\n");
assert(FS && "FS must be set.");

llvm::SmallString<128> AbsoluteFilePath(FileName);
void FileOptionsBaseProvider::addRawFileOptions(
llvm::StringRef AbsolutePath, std::vector<OptionsSource> &CurOptions) {
auto CurSize = CurOptions.size();

if (FS->makeAbsolute(AbsoluteFilePath))
return {};

std::vector<OptionsSource> RawOptions =
DefaultOptionsProvider::getRawOptions(AbsoluteFilePath.str());
OptionsSource CommandLineOptions(OverrideOptions,
OptionsSourceTypeCheckCommandLineOption);
size_t FirstFileConfig = RawOptions.size();
// Look for a suitable configuration file in all parent directories of the
// file. Start with the immediate parent directory and move up.
StringRef Path = llvm::sys::path::parent_path(AbsoluteFilePath.str());
StringRef Path = llvm::sys::path::parent_path(AbsolutePath);
for (StringRef CurrentPath = Path; !CurrentPath.empty();
CurrentPath = llvm::sys::path::parent_path(CurrentPath)) {
llvm::Optional<OptionsSource> Result;
Expand All @@ -272,21 +271,58 @@ FileOptionsProvider::getRawOptions(StringRef FileName) {
}
CachedOptions[Path] = *Result;

RawOptions.push_back(*Result);
if (!Result->first.InheritParentConfig ||
!*Result->first.InheritParentConfig)
CurOptions.push_back(*Result);
if (!Result->first.InheritParentConfig.getValueOr(false))
break;
}
}
// Reverse order of file configs because closer configs should have higher
// priority.
std::reverse(RawOptions.begin() + FirstFileConfig, RawOptions.end());
std::reverse(CurOptions.begin() + CurSize, CurOptions.end());
}

FileOptionsProvider::FileOptionsProvider(
const ClangTidyGlobalOptions &GlobalOptions,
const ClangTidyOptions &DefaultOptions,
const ClangTidyOptions &OverrideOptions,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS)
: FileOptionsBaseProvider(GlobalOptions, DefaultOptions, OverrideOptions,
VFS){};

FileOptionsProvider::FileOptionsProvider(
const ClangTidyGlobalOptions &GlobalOptions,
const ClangTidyOptions &DefaultOptions,
const ClangTidyOptions &OverrideOptions,
const FileOptionsBaseProvider::ConfigFileHandlers &ConfigHandlers)
: FileOptionsBaseProvider(GlobalOptions, DefaultOptions, OverrideOptions,
ConfigHandlers) {}

// FIXME: This method has some common logic with clang::format::getStyle().
// Consider pulling out common bits to a findParentFileWithName function or
// similar.
std::vector<OptionsSource>
FileOptionsProvider::getRawOptions(StringRef FileName) {
LLVM_DEBUG(llvm::dbgs() << "Getting options for file " << FileName
<< "...\n");
assert(FS && "FS must be set.");

llvm::SmallString<128> AbsoluteFilePath(FileName);

if (FS->makeAbsolute(AbsoluteFilePath))
return {};

std::vector<OptionsSource> RawOptions =
DefaultOptionsProvider::getRawOptions(AbsoluteFilePath.str());
addRawFileOptions(AbsoluteFilePath, RawOptions);
OptionsSource CommandLineOptions(OverrideOptions,
OptionsSourceTypeCheckCommandLineOption);

RawOptions.push_back(CommandLineOptions);
return RawOptions;
}

llvm::Optional<OptionsSource>
FileOptionsProvider::tryReadConfigFile(StringRef Directory) {
FileOptionsBaseProvider::tryReadConfigFile(StringRef Directory) {
assert(!Directory.empty());

if (!llvm::sys::fs::is_directory(Directory)) {
Expand Down
Loading

0 comments on commit 7ce7cdb

Please sign in to comment.