[all-commits] [llvm/llvm-project] e953ae: [clang] Use a StringRef instead of a raw char poin...

serge-sans-paille via All-commits all-commits at lists.llvm.org
Sat Dec 24 02:19:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e953ae5bbc313fd0cc980ce021d487e5b5199ea4
      https://github.com/llvm/llvm-project/commit/e953ae5bbc313fd0cc980ce021d487e5b5199ea4
  Author: serge-sans-paille <sguelton at mozilla.com>
  Date:   2022-12-24 (Sat, 24 Dec 2022)

  Changed paths:
    M clang-tools-extra/clangd/CompileCommands.cpp
    M clang/include/clang/Basic/Builtins.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Basic/Builtins.cpp
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Driver/DriverOptions.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
    M clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/DebugContainerModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/ErrnoTesterChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/cert/PutenvWithAutoChecker.cpp
    M clang/lib/StaticAnalyzer/Core/CallDescription.cpp
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M clang/unittests/StaticAnalyzer/BugReportInterestingnessTest.cpp
    M clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
    M clang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
    M clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
    M clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
    M lld/COFF/DriverUtils.cpp
    M lld/ELF/DriverUtils.cpp
    M lld/MachO/DriverUtils.cpp
    M lld/MinGW/Driver.cpp
    M lld/wasm/Driver.cpp
    M lldb/tools/driver/Driver.cpp
    M lldb/tools/lldb-server/lldb-gdbserver.cpp
    M lldb/tools/lldb-vscode/lldb-vscode.cpp
    M llvm/include/llvm/ADT/ArrayRef.h
    M llvm/include/llvm/Option/OptTable.h
    M llvm/include/llvm/Option/Option.h
    M llvm/lib/ExecutionEngine/JITLink/COFFDirectiveParser.cpp
    M llvm/lib/Option/OptTable.cpp
    M llvm/lib/Option/Option.cpp
    M llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
    M llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
    M llvm/tools/dsymutil/dsymutil.cpp
    M llvm/tools/llvm-cvtres/llvm-cvtres.cpp
    M llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
    M llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
    M llvm/tools/llvm-ifs/llvm-ifs.cpp
    M llvm/tools/llvm-lipo/llvm-lipo.cpp
    M llvm/tools/llvm-ml/llvm-ml.cpp
    M llvm/tools/llvm-mt/llvm-mt.cpp
    M llvm/tools/llvm-nm/llvm-nm.cpp
    M llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
    M llvm/tools/llvm-objdump/llvm-objdump.cpp
    M llvm/tools/llvm-rc/llvm-rc.cpp
    M llvm/tools/llvm-readobj/llvm-readobj.cpp
    M llvm/tools/llvm-size/llvm-size.cpp
    M llvm/tools/llvm-strings/llvm-strings.cpp
    M llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
    M llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
    M llvm/unittests/Option/OptionParsingTest.cpp
    M llvm/utils/TableGen/OptParserEmitter.cpp

  Log Message:
  -----------
  [clang] Use a StringRef instead of a raw char pointer to store builtin and call information

This avoids recomputing string length that is already known at compile
time.

It has a slight impact on preprocessing / compile time, see

https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u

This is a recommit of 719d98dfa841c522d8d452f0685e503538415a53 that into
account a GGC issue (probably
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92181) when dealing with
intiailizer_list and constant expressions.

Workaround this by avoiding initializer list, at the expense of a
temporary plain old array.

Differential Revision: https://reviews.llvm.org/D139881




More information about the All-commits mailing list