[PATCH] D68062: Propeller lld framework for basicblock sections

Han Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 17:13:55 PDT 2019


shenhan added inline comments.


================
Comment at: lld/ELF/Propeller.h:136
+                                    uint64_t Size) {
+    auto *Sym = new SymbolEntry(Ordinal, Name, std::move(Aliases),
+                                SymbolEntry::INVALID_ADDRESS, Size,
----------------
ruiu wrote:
> shenhan wrote:
> > MaskRay wrote:
> > > Prefer unique_ptr to raw pointers.
> > unique_ptr<char> type does not work smoothly w/ "getline(char **lineptr, size_t *n, FILE *stream)", which accepts a pointer to pointer parameter, which could be deallocated / reallocated by getline.
> If `getline` doesn't work smoothly with a smart pointer, please consider not using that function. You may want to take a look at `getLines()` in lld/Common/Args.cpp.
Done by using std::ifstream.  (getLines() in lld/Common/Args.cpp keeps all the lines in memory at the same time, which is not efficient for this scenario.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68062/new/

https://reviews.llvm.org/D68062





More information about the llvm-commits mailing list