[clang] 6a0b78a - [OpenMP] Remove static allocator in linker wrapper

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 18:22:49 PST 2022


Author: Joseph Huber
Date: 2022-02-22T21:22:19-05:00
New Revision: 6a0b78af9175af45641c854a88761f284361aaee

URL: https://github.com/llvm/llvm-project/commit/6a0b78af9175af45641c854a88761f284361aaee
DIFF: https://github.com/llvm/llvm-project/commit/6a0b78af9175af45641c854a88761f284361aaee.diff

LOG: [OpenMP] Remove static allocator in linker wrapper

Summary:
We don't need this static allocator to survive the entire file, the
strings stored have a defined lifetime.

Added: 
    

Modified: 
    clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 60a5a0fab59f..2d73e0e574cb 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -142,9 +142,6 @@ static SmallVector<std::string, 16> TempFiles;
 /// Codegen flags for LTO backend.
 static codegen::RegisterCodeGenFlags CodeGenFlags;
 
-/// Static buffer to hold StringRef values.
-static BumpPtrAllocator Alloc;
-
 /// Magic section string that marks the existence of offloading data. The
 /// section string will be formatted as `.llvm.offloading.<triple>.<arch>`.
 #define OFFLOAD_SECTION_MAGIC_STR ".llvm.offloading."
@@ -866,6 +863,7 @@ Error linkBitcodeFiles(SmallVectorImpl<std::string> &InputFiles,
   SmallVector<std::string, 4> NewInputFiles;
   DenseSet<StringRef> UsedInRegularObj;
   DenseSet<StringRef> UsedInSharedLib;
+  BumpPtrAllocator Alloc;
   StringSaver Saver(Alloc);
 
   // Search for bitcode files in the input and create an LTO input file. If it


        


More information about the cfe-commits mailing list