Skip to content

Commit 05753f7

Browse files
committed
Cleanup
1 parent d25308d commit 05753f7

File tree

16 files changed

+87
-135
lines changed

16 files changed

+87
-135
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,13 +983,10 @@ ToolChain::getTargetSubDirPath(StringRef BaseDir) const {
983983
return {};
984984
}
985985

986-
987-
988-
989986
std::optional< std::string> ToolChain::getDefaultIntrinsicModuleDir( ) const {
990987
SmallString<128> P(D.ResourceDir);
991988
llvm::sys::path::append(P, "finclude");
992-
return getTargetSubDirPath(P );
989+
return getTargetSubDirPath(P );
993990
}
994991

995992
std::optional<std::string> ToolChain::getRuntimePath() const {

flang-rt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ set(LLVM_TOOLS_DIR "${LLVM_BINARY_DIR}/bin")
8181
# command has to apply CMAKE_INSTALL_PREFIX itself.
8282
get_toolchain_library_subdir(toolchain_lib_subdir)
8383
get_toolchain_module_subdir(toolchain_mod_subdir)
84+
8485
if (LLVM_TREE_AVAILABLE)
8586
# In a bootstrap build emit the libraries into a default search path in the
8687
# build directory of the just-built compiler. This allows using the

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ function (add_flangrt_library name)
182182
endif ()
183183
add_library(${name}.default ALIAS "${default_target}")
184184

185-
186-
187185
# Provide a build target that builds any enabled library.
188186
# Not intended for target_link_libraries. Either use the ${name}.static,
189187
# ${name}.shared variants, or ${name}.default to let BUILD_SHARED_LIBS

flang/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
279279
"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
280280
mark_as_advanced(FLANG_TOOLS_INSTALL_DIR)
281281

282-
#set(FLANG_INTRINSIC_MODULES_DIR "${CMAKE_BINARY_DIR}/lib/clang/21/finclude/x86_64-unknown-linux-gnu")
283-
set(FLANG_INTRINSIC_MODULES_DIR "" CACHE PATH "Additional search path for modules; needed for tests if not building flang-rt in a bootstrapping build")
282+
set(FLANG_INTRINSIC_MODULES_DIR "" CACHE PATH "Additional search path for modules; needed for running all tests if not building flang-rt in a bootstrapping build")
284283
set(FLANG_INCLUDE_DIR "${FLANG_BINARY_DIR}/include")
285284

286285
# TODO: Remove when libclangDriver is lifted out of Clang

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ static void parsePreprocessorArgs(Fortran::frontend::PreprocessorOptions &opts,
914914
for (const auto *currentArg : args.filtered(clang::driver::options::OPT_I))
915915
opts.searchDirectoriesFromDashI.emplace_back(currentArg->getValue());
916916

917-
// Prepend the ordered list of -fintrinsic-modules-path
917+
// Prepend the ordered list of -intrinsic-modules-path
918918
// to the default location to search.
919919
for (const auto *currentArg :
920920
args.filtered(clang::driver::options::OPT_fintrinsic_modules_path))

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,12 +1363,11 @@ getTypeDescriptor(ModOpTy mod, mlir::ConversionPatternRewriter &rewriter,
13631363
name, Fortran::semantics::typeInfoBuiltinModule))
13641364
return rewriter.create<mlir::LLVM::ZeroOp>(loc, llvmPtrTy);
13651365

1366-
if (!options.skipExternalRttiDefinition) { llvm::errs() << "type dewxriptor name: '" << name << "'\n";
1366+
if (!options.skipExternalRttiDefinition)
13671367
fir::emitFatalError(loc,
13681368
"runtime derived type info descriptor was not "
13691369
"generated and skipExternalRttiDefinition and "
13701370
"ignoreMissingTypeDescriptors options are not set");
1371-
}
13721371

13731372
// Rtti for a derived type defined in another compilation unit and for which
13741373
// rtti was not defined in lowering because of the skipExternalRttiDefinition

flang/lib/Parser/parsing.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
#include "flang/Parser/provenance.h"
1515
#include "flang/Parser/source.h"
1616
#include "llvm/Support/raw_ostream.h"
17-
#include "llvm/Support/Debug.h"
18-
19-
#define DEBUG_TYPE "flang"
2017

2118
namespace Fortran::parser {
2219

@@ -26,8 +23,7 @@ Parsing::~Parsing() {}
2623
const SourceFile *Parsing::Prescan(const std::string &path, Options options) {
2724
options_ = options;
2825
AllSources &allSources{allCooked_.allSources()};
29-
allSources.ClearSearchPath();
30-
LLVM_DEBUG(llvm::dbgs() << "Prescan('" << path << "', " << options.isModuleFile << ")\n");
26+
allSources.ClearSearchPath();
3127
if (options.isModuleFile) {
3228
for (const auto &path : options.searchDirectories) {
3329
allSources.AppendSearchPathDirectory(path);

flang/lib/Parser/provenance.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
#include "flang/Parser/provenance.h"
1010
#include "flang/Common/idioms.h"
1111
#include "llvm/Support/raw_ostream.h"
12-
#include "llvm/Support/Debug.h"
1312
#include <algorithm>
1413
#include <set>
1514
#include <utility>
1615

17-
#define DEBUG_TYPE "flang"
18-
1916
namespace Fortran::parser {
2017

2118
ProvenanceRangeToOffsetMappings::ProvenanceRangeToOffsetMappings() {}
@@ -189,15 +186,7 @@ const SourceFile *AllSources::Open(std::string path, llvm::raw_ostream &error,
189186
// INCLUDE statements.
190187
searchPath_.emplace_front(std::move(*prependPath));
191188
}
192-
193-
LLVM_DEBUG( llvm::errs() << "Open('" << path << "', '" << prependPath << "')\n");
194-
for (auto &&sp : searchPath_) {
195-
LLVM_DEBUG( llvm::errs() << " " << sp << "\n");
196-
}
197-
LLVM_DEBUG( llvm::errs() << "\n");
198189
std::optional<std::string> found{LocateSourceFile(path, searchPath_)};
199-
LLVM_DEBUG( llvm::errs() << "Found = '" << found << "')\n");
200-
201190
if (prependPath) {
202191
searchPath_.pop_front();
203192
}

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,44 +3045,39 @@ void OmpStructureChecker::CheckSharedBindingInOuterContext(
30453045
// TODO: Verify the assumption here that the immediately enclosing region is
30463046
// the parallel region to which the worksharing construct having reduction
30473047
// binds to.
3048-
auto enclosingContext{GetEnclosingDirContext()};
3049-
if (!enclosingContext)
3050-
return;
3051-
3052-
for (auto [type, clause] : enclosingContext->clauseInfo) {
3053-
if (!llvm::omp::privateReductionSet.test(type))
3054-
continue;
3055-
3056-
const auto *objList{GetOmpObjectList(*clause)};
3057-
for (const auto &ompObject : objList->v) {
3058-
const auto *name{parser::Unwrap<parser::Name>(ompObject)};
3059-
if (!name)
3060-
continue;
3061-
3062-
const auto *symbol{name->symbol};
3063-
if (!symbol)
3064-
continue;
3065-
3066-
for (const auto &redOmpObject : redObjectList.v) {
3067-
const auto *rname{parser::Unwrap<parser::Name>(redOmpObject)};
3068-
if (!rname)
3069-
continue;
3070-
3071-
const auto *rsymbol{rname->symbol};
3072-
if (!rsymbol)
3073-
continue;
3074-
3075-
if (rsymbol->name() != symbol->name())
3076-
continue;
3077-
3078-
context_.Say(GetContext().clauseSource,
3079-
"%s variable '%s' is %s in outer context must be shared in the "
3080-
"parallel regions to which any of the worksharing regions arising "
3081-
"from the worksharing construct bind."_err_en_US,
3082-
parser::ToUpperCaseLetters(
3083-
getClauseName(llvm::omp::Clause::OMPC_reduction).str()),
3084-
symbol->name(),
3085-
parser::ToUpperCaseLetters(getClauseName(type).str()));
3048+
if (auto *enclosingContext{GetEnclosingDirContext()}) {
3049+
for (auto it : enclosingContext->clauseInfo) {
3050+
llvmOmpClause type = it.first;
3051+
const auto *clause = it.second;
3052+
if (llvm::omp::privateReductionSet.test(type)) {
3053+
if (const auto *objList{GetOmpObjectList(*clause)}) {
3054+
for (const auto &ompObject : objList->v) {
3055+
if (const auto *name{parser::Unwrap<parser::Name>(ompObject)}) {
3056+
if (const auto *symbol{name->symbol}) {
3057+
for (const auto &redOmpObject : redObjectList.v) {
3058+
if (const auto *rname{
3059+
parser::Unwrap<parser::Name>(redOmpObject)}) {
3060+
if (const auto *rsymbol{rname->symbol}) {
3061+
if (rsymbol->name() == symbol->name()) {
3062+
context_.Say(GetContext().clauseSource,
3063+
"%s variable '%s' is %s in outer context must"
3064+
" be shared in the parallel regions to which any"
3065+
" of the worksharing regions arising from the "
3066+
"worksharing construct bind."_err_en_US,
3067+
parser::ToUpperCaseLetters(
3068+
getClauseName(llvm::omp::Clause::OMPC_reduction)
3069+
.str()),
3070+
symbol->name(),
3071+
parser::ToUpperCaseLetters(
3072+
getClauseName(type).str()));
3073+
}
3074+
}
3075+
}
3076+
}
3077+
}
3078+
}
3079+
}
3080+
}
30863081
}
30873082
}
30883083
}

flang/lib/Semantics/mod-file.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@
2020
#include "llvm/Support/FileSystem.h"
2121
#include "llvm/Support/MemoryBuffer.h"
2222
#include "llvm/Support/raw_ostream.h"
23-
#include "llvm/Support/CommandLine.h"
2423
#include <algorithm>
2524
#include <fstream>
2625
#include <set>
2726
#include <string_view>
2827
#include <variant>
2928
#include <vector>
3029

31-
32-
3330
namespace Fortran::semantics {
3431

3532
using namespace parser::literals;
@@ -1385,9 +1382,6 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
13851382
}
13861383
ancestorName = ancestor->GetName().value().ToString();
13871384
}
1388-
1389-
1390-
13911385
auto requiredHash{context_.moduleDependences().GetRequiredHash(
13921386
name.ToString(), isIntrinsic.value_or(false))};
13931387
if (!isIntrinsic.value_or(false) && !ancestor) {

0 commit comments

Comments
 (0)