summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-3/+2
| | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* Merge topic 'improve-character-find-and-replace'Brad King2016-05-251-1/+1
|\ | | | | | | | | | | | | | | 5784747d Improve string find: prefer character overloads. 5cec953e Use std::replace for replacing chars in strings. 2a1a2033 cmExtraEclipseCDT4Generator: use std::replace. 34bc6e1f cmCTestScriptHandler: don't call find repeatedly.
| * Improve string find: prefer character overloads.Daniel Pfeifer2016-05-241-1/+1
| | | | | | | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
* | Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-20/+20
|/ | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-299/+208
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmLocalGenerator: Add current binary directory accessor.Stephen Kelly2015-10-101-1/+1
|
* cmDependsFortran: Use string to store module directoryBrad King2015-07-291-8/+5
|
* cmFortranParser: Factor out of cmDependsFortranBrad King2015-07-271-465/+0
| | | | | Move the main parser class and method implementations out of cmDependsFortran.cxx and into separate source files.
* cmDependsFortran: Simplify storage of preprocessor definitionsBrad King2015-07-271-12/+8
| | | | | | Collect the original preprocessor definitions in a std::set<> so that it can be copied directly by cmFortranParser's constructor instead of making a copy on the stack.
* cmDependsFortran: Move FindIncludeFile method into parser classBrad King2015-07-271-14/+17
| | | | | This drops the only awareness of cmDependsFortran that cmFortranParser needed.
* Rename Fortran parser infrastructure to drop "Depends" prefixKitware Robot2015-07-271-71/+71
| | | | | | | | | | | The parser can be re-used outside cmDependsFortran or the cmDepends class hierarchy so drop the "Depends" from its name: rename 's/DependsFortran([A-Za-z0-9_])/Fortran$1/' Source/*.* sed -i 's/DependsFortran\([A-Za-z0-9_]\)/Fortran\1/g' Source/*.* sed -i 's/FortranInternals/DependsFortranInternals/g' Source/*.* Also manually fix Source/CMakeLists.txt source file ordering.
* Fortran: Fix passing of preprocessor definitions to dependency scannerBrad King2015-07-061-1/+1
| | | | | | | | | | In commit v3.3.0-rc1~352^2~3 (Genex: Allow COMPILE_LANGUAGE when processing compile definitions, 2015-03-04) the name of the variable used to pass preprocessor definitions to the Fortran dependency scanner was changed to be per-language, but the actual dependency scanning code was not updated accordingly. Update the code and add a test case. Reported-by: Radovan Bast <radovan.bast@gmail.com>
* cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-1/+1
| | | | Match names used in CMake code.
* Use two-iterator std::set::insert where appropriate.Stephen Kelly2015-01-111-7/+3
|
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-2/+2
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* cmDepends: Refactor object file path conversionBrad King2014-07-221-9/+14
| | | | | | | | Delay conversion of the path to object files (on the left-hand side of dependencies) until just before they are written. Also do not convert the format of paths written to the 'depend.internal' file. This is consistent with the way the right-hand side of dependencies are already handled.
* cmLocalGenerator: Rename 'MAKEFILE' to 'MAKERULE'Brad King2014-07-221-6/+6
| | | | | Rename the internal enumeration value for converting paths destined for use in Makefile rule syntax.
* Merge topic 'gfortran-compressed-modules'Brad King2014-06-241-14/+27
|\ | | | | | | | | d90be200 Fortran: Add support for GNU >= 4.9 compressed modules (#14975)
| * Fortran: Add support for GNU >= 4.9 compressed modules (#14975)Brad King2014-06-231-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From the GCC 4.9 release notes for Fortran: https://gcc.gnu.org/gcc-4.9/changes.html "Module files: The version of the module files (.mod) has been incremented; additionally, module files are now compressed." Teach cmDependsFortran::ModulesDiffer to look for the gzip magic numbers at the beginning of the module file. If found, assume the module was produced by gfortran >= 4.9. The modules do not appear to contain the date as earlier versions did so we can compare the content directly and do not actually need to decompress.
* | Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-6/+6
| | | | | | | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* | Remove some c_str() calls.Stephen Kelly2014-03-111-11/+11
| | | | | | | | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* | strings: Remove cmStdString referencesBen Boeckel2014-03-081-20/+20
|/ | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-10/+10
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* cmDepends: allow multiple dependees per dependerAlex Neundorf2012-11-061-23/+29
| | | | | | | | | | | | | | | | | | | | | This patch is heavily inspired by Michael Wild. The interfaces cmDepends::Write and cmDepends::WriteDependencies where extended to allow multiple dependees (sources) per depender (object). cmDepends::Write first collect all dependencies into a std::set before passing it to cmDepends::WriteDependencies. cmDependsC::WriteDependencies also first collects all explicit and implicit dependencies into a std::set and only then writes depend.{internal,make}. The implementation of cmDependsFortran simply loops over all sources and proceeds as before, whereas the cmDependsJava implementation is as trivial as before. This is for preventing exponential growth of depend.{internal,make} in the next commit which fixes dependency-vector erasure in cmDepends::CheckDependencies. Inspired-by: Michael Wild <themiwi@users.sourceforge.net>
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Run vim spellcheck on some filesYury G. Kudryashov2012-02-291-6/+6
|
* Fix escapes in Fortran depend.make entriesBrad King2010-01-041-5/+7
| | | | | | | Makefile dependencies must be escaped using cmLocalGenerator::Convert with the cmLocalGenerator::MAKEFILE option. This fixes Fortran module dependencies with spaces in the path. We test the fix by adding a space to one of the module paths in the Fortran test.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* BUG: Fix Fortran implicit dependency include pathBrad King2009-02-241-0/+3
| | | | | | | | The previous change to Source/cmDependsFortran.cxx while refactoring implicit dependency scanning configuration rules completely broke loading of the include file search path while scanning Fortran dependencies. This adds the line that should have been added during the previous change to load the include path correctly.
* ENH: Light refactoring of implicit dependency scanning configuration ↵Brad King2008-05-081-11/+14
| | | | | | implementation. - Move lookup of config variables from cmLocalUnixMakefileGenerator3 to cmDepends hierarchy.
* BUG: Fix Fortran dependency parser preprocessor handling crash.Brad King2008-04-211-2/+4
| | | | | | - Do not crash if a #elseif occurs out of order - Recognize preprocessor directives only at the beginning of lines. - See issue #6855
* COMP: Fix build on Borland 5.5.Brad King2008-01-181-1/+2
|
* ENH: Enable use of COMPILE_DEFINITIONS property for Fortran sources.Brad King2008-01-181-15/+6
|
* COMP: Fix build on VS6.Brad King2008-01-101-4/+4
|
* ENH: Patch from Maik to add preprocessor directive handling to Fortran ↵Brad King2008-01-091-19/+180
| | | | dependency scanning. Also added -fpp flag to Intel Fortran compiler on Windows by default.
* BUG: make it compile on vs 6Bill Hoffman2008-01-081-3/+3
|
* ENH: Changes based on patch from Maik for better ↵Brad King2008-01-071-48/+125
| | | | cmDependsFortran::ModulesDiffer.
* ENH: Cleanup Fortran build directories by placing module stamp files in the ↵Brad King2008-01-021-9/+5
| | | | target directory that builds them. This is actually a simpler implementation anyway.
* ENH: Make the Fortran compiler id available to cmDependsFortran at scanning ↵Brad King2008-01-021-4/+21
| | | | and module timestamp copy time.
* ENH: Changes based on patch from Maik Beckmann to copy fortran modules to ↵Brad King2007-12-311-10/+112
| | | | timestamps only if they have really changed. This optimization should reduce extra rebuilds caused by dependencies on modules whose providers have recompiled but whose interfaces have not changed.
* ENH: Implemented Fortran module output directory and search path flags.Brad King2007-12-301-20/+54
|
* ENH: Simplify Fortran module proxy dependency implementation by removing ↵Brad King2007-12-301-3/+0
| | | | unnecessary target.
* COMP: Fix uninitialized variable and unused parameter warnings.Brad King2007-12-291-2/+2
|
* ENH: Add per-language clean rule generation to cmake_clean.cmake files to ↵Brad King2007-12-281-0/+21
| | | | include cmake_clean_<lang>.cmake files generated by dependency scanning. Add Fortran module file and timestamp cleaning rules.
* ENH: Implement Fortran module dependencies across targets and directories.Brad King2007-12-281-119/+330
| | | | | | | | | - See issue #5809 - Keep information about all sources in the target until deps are written - Create a fortran.internal file after scanning that lists modules provided - Load fortran.internal files from linked targets to find modules - Search the include path for external modules - Create file-level deps on in-project module timestamps or external mods
* ENH: Convert cmDepends object interface to scan an entire target at once.Brad King2007-12-231-3/+2
|
* BUG: cmDependsFortran should store the source file as a dependency of the ↵Brad King2007-12-191-0/+1
| | | | object file when scanning for dependencies.
* ENH: Pass target directory to cmDependsFortran scanning instances.Brad King2007-12-191-4/+9
|