llvm.org GIT mirror llvm / af1531a
[Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305119 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Zelenko 2 years ago
9 changed file(s) with 314 addition(s) and 244 deletion(s). Raw diff Collapse all Expand all
None //===-- llvm/Support/Casting.h - Allow flexible, checked, casts -*- C++ -*-===//
0 //===- llvm/Support/Casting.h - Allow flexible, checked, casts --*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1818 #include "llvm/Support/type_traits.h"
1919 #include
2020 #include
21 #include
2122
2223 namespace llvm {
2324
3031 // template selection process... the default implementation is a noop.
3132 //
3233 template struct simplify_type {
33 typedef From SimpleType; // The real type this represents...
34 using SimpleType = From; // The real type this represents...
3435
3536 // An accessor to get the real value...
3637 static SimpleType &getSimplifiedValue(From &Val) { return Val; }
3738 };
3839
3940 template struct simplify_type {
40 typedef typename simplify_type::SimpleType NonConstSimpleType;
41 typedef typename add_const_past_pointer::type
42 SimpleType;
43 typedef typename add_lvalue_reference_if_not_pointer::type
44 RetType;
41 using NonConstSimpleType = typename simplify_type::SimpleType;
42 using SimpleType =
43 typename add_const_past_pointer::type;
44 using RetType =
45 typename add_lvalue_reference_if_not_pointer::type;
46
4547 static RetType getSimplifiedValue(const From& Val) {
4648 return simplify_type::getSimplifiedValue(const_cast(Val));
4749 }
147149
148150 template struct cast_retty;
149151
150
151152 // Calculate what type the 'cast' function should return, based on a requested
152153 // type of To and a source type of From.
153154 template struct cast_retty_impl {
154 typedef To& ret_type; // Normal case, return Ty&
155 using ret_type = To &; // Normal case, return Ty&
155156 };
156157 template struct cast_retty_impl {
157 typedef const To &ret_type; // Normal case, return Ty&
158 using ret_type = const To &; // Normal case, return Ty&
158159 };
159160
160161 template struct cast_retty_impl {
161 typedef To* ret_type; // Pointer arg case, return Ty*
162 using ret_type = To *; // Pointer arg case, return Ty*
162163 };
163164
164165 template struct cast_retty_impl {
165 typedef const To* ret_type; // Constant pointer arg case, return const Ty*
166 using ret_type = const To *; // Constant pointer arg case, return const Ty*
166167 };
167168
168169 template struct cast_retty_impl {
169 typedef const To* ret_type; // Constant pointer arg case, return const Ty*
170 using ret_type = const To *; // Constant pointer arg case, return const Ty*
170171 };
171172
172173 template
173174 struct cast_retty_impl> {
174175 private:
175 typedef typename cast_retty_impl::ret_type PointerType;
176 typedef typename std::remove_pointer::type ResultType;
176 using PointerType = typename cast_retty_impl::ret_type;
177 using ResultType = typename std::remove_pointer::type;
177178
178179 public:
179 typedef std::unique_ptr ret_type;
180 using ret_type = std::unique_ptr;
180181 };
181182
182183 template
184185 // When the simplified type and the from type are not the same, use the type
185186 // simplifier to reduce the type, then reuse cast_retty_impl to get the
186187 // resultant type.
187 typedef typename cast_retty::ret_type ret_type;
188 using ret_type = typename cast_retty::ret_type;
188189 };
189190
190191 template
191192 struct cast_retty_wrap {
192193 // When the simplified type is equal to the from type, use it directly.
193 typedef typename cast_retty_impl::ret_type ret_type;
194 using ret_type = typename cast_retty_impl::ret_type;
194195 };
195196
196197 template
197198 struct cast_retty {
198 typedef typename cast_retty_wrap
199 typename simplify_type::SimpleType>::ret_type ret_type;
199 using ret_type = typename cast_retty_wrap<
200 To, From, typename simplify_type::SimpleType>::ret_type;
200201 };
201202
202203 // Ensure the non-simple values are converted using the simplify_type template
392393 return unique_dyn_cast_or_null(Val);
393394 }
394395
395 } // End llvm namespace
396
397 #endif
396 } // end namespace llvm
397
398 #endif // LLVM_SUPPORT_CASTING_H
3232 #include
3333 #include
3434 #include
35 #include
3536 #include
3637 #include
3738 #include
4041 namespace llvm {
4142
4243 class StringSaver;
44 class raw_ostream;
4345
4446 /// cl Namespace - This namespace contains all of the command line option
4547 /// processing machinery. It is intentionally a short name to make qualified
6466 const char *Overview = "");
6567
6668 // Function pointer type for printing version information.
67 typedef std::function VersionPrinterTy;
69 using VersionPrinterTy = std::function;
6870
6971 ///===---------------------------------------------------------------------===//
7072 /// SetVersionPrinter - Override the default (LLVM specific) version printer
244246 // Out of line virtual function to provide home for the class.
245247 virtual void anchor();
246248
247 int NumOccurrences; // The number of times specified
249 int NumOccurrences = 0; // The number of times specified
248250 // Occurrences, HiddenFlag, and Formatting are all enum types but to avoid
249251 // problems with signed enums in bitfields.
250252 unsigned Occurrences : 3; // enum NumOccurrencesFlag
254256 unsigned HiddenFlag : 2; // enum OptionHidden
255257 unsigned Formatting : 2; // enum FormattingFlags
256258 unsigned Misc : 3;
257 unsigned Position; // Position of last occurrence of the option
258 unsigned AdditionalVals; // Greater than 0 for multi-valued option.
259 unsigned Position = 0; // Position of last occurrence of the option
260 unsigned AdditionalVals = 0; // Greater than 0 for multi-valued option.
259261
260262 public:
261263 StringRef ArgStr; // The argument string itself (ex: "help", "o")
263265 StringRef ValueStr; // String describing what the value of this option is
264266 OptionCategory *Category; // The Category this option belongs to
265267 SmallPtrSet Subs; // The subcommands this option belongs to.
266 bool FullyInitialized; // Has addArguemnt been called?
268 bool FullyInitialized = false; // Has addArguemnt been called?
267269
268270 inline enum NumOccurrencesFlag getNumOccurrencesFlag() const {
269271 return (enum NumOccurrencesFlag)Occurrences;
318320 protected:
319321 explicit Option(enum NumOccurrencesFlag OccurrencesFlag,
320322 enum OptionHidden Hidden)
321 : NumOccurrences(0), Occurrences(OccurrencesFlag), Value(0),
322 HiddenFlag(Hidden), Formatting(NormalFormatting), Misc(0), Position(0),
323 AdditionalVals(0), Category(&GeneralCategory), FullyInitialized(false) {
324 }
323 : Occurrences(OccurrencesFlag), Value(0), HiddenFlag(Hidden),
324 Formatting(NormalFormatting), Misc(0), Category(&GeneralCategory) {}
325325
326326 inline void setNumAdditionalVals(unsigned n) { AdditionalVals = n; }
327327
449449 protected:
450450 GenericOptionValue() = default;
451451 GenericOptionValue(const GenericOptionValue&) = default;
452 GenericOptionValue &operator=(const GenericOptionValue &) = default;
452453 ~GenericOptionValue() = default;
453 GenericOptionValue &operator=(const GenericOptionValue &) = default;
454454
455455 private:
456456 virtual void anchor();
463463 template
464464 struct OptionValueBase : public GenericOptionValue {
465465 // Temporary storage for argument passing.
466 typedef OptionValue WrapperType;
466 using WrapperType = OptionValue;
467467
468468 bool hasValue() const { return false; }
469469
489489
490490 protected:
491491 OptionValueCopy(const OptionValueCopy&) = default;
492 OptionValueCopy &operator=(const OptionValueCopy &) = default;
492493 ~OptionValueCopy() = default;
493 OptionValueCopy &operator=(const OptionValueCopy&) = default;
494494
495495 public:
496496 OptionValueCopy() = default;
521521 // Non-class option values.
522522 template
523523 struct OptionValueBase : OptionValueCopy {
524 typedef DataType WrapperType;
524 using WrapperType = DataType;
525525
526526 protected:
527527 OptionValueBase() = default;
528528 OptionValueBase(const OptionValueBase&) = default;
529 OptionValueBase &operator=(const OptionValueBase &) = default;
529530 ~OptionValueBase() = default;
530 OptionValueBase &operator=(const OptionValueBase&) = default;
531531 };
532532
533533 // Top-level option class.
550550 template <>
551551 struct OptionValue final
552552 : OptionValueCopy {
553 typedef cl::boolOrDefault WrapperType;
553 using WrapperType = cl::boolOrDefault;
554554
555555 OptionValue() = default;
556556
567567
568568 template <>
569569 struct OptionValue final : OptionValueCopy {
570 typedef StringRef WrapperType;
570 using WrapperType = StringRef;
571571
572572 OptionValue() = default;
573573
738738 public:
739739 OptionInfo(StringRef name, DataType v, StringRef helpStr)
740740 : GenericOptionInfo(name, helpStr), V(v) {}
741
741742 OptionValue V;
742743 };
743744 SmallVector Values;
744745
745746 public:
746747 parser(Option &O) : generic_parser_base(O) {}
747 typedef DataType parser_data_type;
748
749 using parser_data_type = DataType;
748750
749751 // Implement virtual functions needed by generic_parser_base
750752 unsigned getNumOptions() const override { return unsigned(Values.size()); }
839841 //
840842 template class basic_parser : public basic_parser_impl {
841843 public:
844 using parser_data_type = DataType;
845 using OptVal = OptionValue;
846
842847 basic_parser(Option &O) : basic_parser_impl(O) {}
843
844 typedef DataType parser_data_type;
845 typedef OptionValue OptVal;
846848
847849 protected:
848850 ~basic_parser() = default;
12941296 enum ValueExpected getValueExpectedFlagDefault() const override {
12951297 return Parser.getValueExpectedFlagDefault();
12961298 }
1299
12971300 void getExtraOptionNames(SmallVectorImpl &OptionNames) override {
12981301 return Parser.getExtraOptionNames(OptionNames);
12991302 }
13021305 size_t getOptionWidth() const override {
13031306 return Parser.getOptionWidth(*this);
13041307 }
1308
13051309 void printOptionInfo(size_t GlobalWidth) const override {
13061310 Parser.printOptionInfo(*this, GlobalWidth);
13071311 }
13861390 std::vector Storage;
13871391
13881392 public:
1389 typedef typename std::vector::iterator iterator;
1393 using iterator = typename std::vector::iterator;
13901394
13911395 iterator begin() { return Storage.begin(); }
13921396 iterator end() { return Storage.end(); }
13931397
1394 typedef typename std::vector::const_iterator const_iterator;
1398 using const_iterator = typename std::vector::const_iterator;
1399
13951400 const_iterator begin() const { return Storage.begin(); }
13961401 const_iterator end() const { return Storage.end(); }
13971402
1398 typedef typename std::vector::size_type size_type;
1403 using size_type = typename std::vector::size_type;
1404
13991405 size_type size() const { return Storage.size(); }
14001406
14011407 bool empty() const { return Storage.empty(); }
14031409 void push_back(const DataType &value) { Storage.push_back(value); }
14041410 void push_back(DataType &&value) { Storage.push_back(value); }
14051411
1406 typedef typename std::vector::reference reference;
1407 typedef typename std::vector::const_reference const_reference;
1412 using reference = typename std::vector::reference;
1413 using const_reference = typename std::vector::const_reference;
1414
14081415 reference operator[](size_type pos) { return Storage[pos]; }
14091416 const_reference operator[](size_type pos) const { return Storage[pos]; }
14101417
14551462 enum ValueExpected getValueExpectedFlagDefault() const override {
14561463 return Parser.getValueExpectedFlagDefault();
14571464 }
1465
14581466 void getExtraOptionNames(SmallVectorImpl &OptionNames) override {
14591467 return Parser.getExtraOptionNames(OptionNames);
14601468 }
14751483 size_t getOptionWidth() const override {
14761484 return Parser.getOptionWidth(*this);
14771485 }
1486
14781487 void printOptionInfo(size_t GlobalWidth) const override {
14791488 Parser.printOptionInfo(*this, GlobalWidth);
14801489 }
15941603 enum ValueExpected getValueExpectedFlagDefault() const override {
15951604 return Parser.getValueExpectedFlagDefault();
15961605 }
1606
15971607 void getExtraOptionNames(SmallVectorImpl &OptionNames) override {
15981608 return Parser.getExtraOptionNames(OptionNames);
15991609 }
16141624 size_t getOptionWidth() const override {
16151625 return Parser.getOptionWidth(*this);
16161626 }
1627
16171628 void printOptionInfo(size_t GlobalWidth) const override {
16181629 Parser.printOptionInfo(*this, GlobalWidth);
16191630 }
18261837
18271838 /// \brief String tokenization function type. Should be compatible with either
18281839 /// Windows or Unix command line tokenizers.
1829 typedef void (*TokenizerCallback)(StringRef Source, StringSaver &Saver,
1830 SmallVectorImpl &NewArgv,
1831 bool MarkEOLs);
1840 using TokenizerCallback = void (*)(StringRef Source, StringSaver &Saver,
1841 SmallVectorImpl &NewArgv,
1842 bool MarkEOLs);
18321843
18331844 /// \brief Expand response files on a command line recursively using the given
18341845 /// StringSaver and tokenization strategy. Argv should contain the command line
18821893 void ResetCommandLineParser();
18831894
18841895 } // end namespace cl
1896
18851897 } // end namespace llvm
18861898
18871899 #endif // LLVM_SUPPORT_COMMANDLINE_H
1313 #ifndef LLVM_SUPPORT_ENDIAN_H
1414 #define LLVM_SUPPORT_ENDIAN_H
1515
16 #include "llvm/Support/AlignOf.h"
17 #include "llvm/Support/Compiler.h"
1618 #include "llvm/Support/Host.h"
1719 #include "llvm/Support/SwapByteOrder.h"
18
19 #include <stdint.h>
20 #include <cassert>
21 #include
22 #include
23 #include
24 #include
2025
2126 namespace llvm {
2227 namespace support {
28
2329 enum endianness {big, little, native};
2430
2531 // These are named values for common alignments.
2632 enum {aligned = 0, unaligned = 1};
2733
2834 namespace detail {
29 /// \brief ::value is either alignment, or alignof(T) if alignment is 0.
30 template
31 struct PickAlignment {
32 enum { value = alignment == 0 ? alignof(T) : alignment };
33 };
35
36 /// \brief ::value is either alignment, or alignof(T) if alignment is 0.
37 template
38 struct PickAlignment {
39 enum { value = alignment == 0 ? alignof(T) : alignment };
40 };
41
3442 } // end namespace detail
3543
3644 namespace endian {
45
3746 constexpr endianness system_endianness() {
3847 return sys::IsBigEndianHost ? big : little;
3948 }
189198 &val[0], sizeof(value_type) * 2);
190199 }
191200 }
201
192202 } // end namespace endian
193203
194204 namespace detail {
205
195206 template
196207 endianness endian,
197208 std::size_t alignment>
253264
254265 } // end namespace detail
255266
256 typedef detail::packed_endian_specific_integral
257 ulittle16_t;
258 typedef detail::packed_endian_specific_integral
259 ulittle32_t;
260 typedef detail::packed_endian_specific_integral
261 ulittle64_t;
262
263 typedef detail::packed_endian_specific_integral
264 little16_t;
265 typedef detail::packed_endian_specific_integral
266 little32_t;
267 typedef detail::packed_endian_specific_integral
268 little64_t;
269
270 typedef detail::packed_endian_specific_integral
271 aligned_ulittle16_t;
272 typedef detail::packed_endian_specific_integral
273 aligned_ulittle32_t;
274 typedef detail::packed_endian_specific_integral
275 aligned_ulittle64_t;
276
277 typedef detail::packed_endian_specific_integral
278 aligned_little16_t;
279 typedef detail::packed_endian_specific_integral
280 aligned_little32_t;
281 typedef detail::packed_endian_specific_integral
282 aligned_little64_t;
283
284 typedef detail::packed_endian_specific_integral
285 ubig16_t;
286 typedef detail::packed_endian_specific_integral
287 ubig32_t;
288 typedef detail::packed_endian_specific_integral
289 ubig64_t;
290
291 typedef detail::packed_endian_specific_integral
292 big16_t;
293 typedef detail::packed_endian_specific_integral
294 big32_t;
295 typedef detail::packed_endian_specific_integral
296 big64_t;
297
298 typedef detail::packed_endian_specific_integral
299 aligned_ubig16_t;
300 typedef detail::packed_endian_specific_integral
301 aligned_ubig32_t;
302 typedef detail::packed_endian_specific_integral
303 aligned_ubig64_t;
304
305 typedef detail::packed_endian_specific_integral
306 aligned_big16_t;
307 typedef detail::packed_endian_specific_integral
308 aligned_big32_t;
309 typedef detail::packed_endian_specific_integral
310 aligned_big64_t;
311
312 typedef detail::packed_endian_specific_integral
313 unaligned_uint16_t;
314 typedef detail::packed_endian_specific_integral
315 unaligned_uint32_t;
316 typedef detail::packed_endian_specific_integral
317 unaligned_uint64_t;
318
319 typedef detail::packed_endian_specific_integral
320 unaligned_int16_t;
321 typedef detail::packed_endian_specific_integral
322 unaligned_int32_t;
323 typedef detail::packed_endian_specific_integral
324 unaligned_int64_t;
267 using ulittle16_t =
268 detail::packed_endian_specific_integral;
269 using ulittle32_t =
270 detail::packed_endian_specific_integral;
271 using ulittle64_t =
272 detail::packed_endian_specific_integral;
273
274 using little16_t =
275 detail::packed_endian_specific_integral;
276 using little32_t =
277 detail::packed_endian_specific_integral;
278 using little64_t =
279 detail::packed_endian_specific_integral;
280
281 using aligned_ulittle16_t =
282 detail::packed_endian_specific_integral;
283 using aligned_ulittle32_t =
284 detail::packed_endian_specific_integral;
285 using aligned_ulittle64_t =
286 detail::packed_endian_specific_integral;
287
288 using aligned_little16_t =
289 detail::packed_endian_specific_integral;
290 using aligned_little32_t =
291 detail::packed_endian_specific_integral;
292 using aligned_little64_t =
293 detail::packed_endian_specific_integral;
294
295 using ubig16_t =
296 detail::packed_endian_specific_integral;
297 using ubig32_t =
298 detail::packed_endian_specific_integral;
299 using ubig64_t =
300 detail::packed_endian_specific_integral;
301
302 using big16_t =
303 detail::packed_endian_specific_integral;
304 using big32_t =
305 detail::packed_endian_specific_integral;
306 using big64_t =
307 detail::packed_endian_specific_integral;
308
309 using aligned_ubig16_t =
310 detail::packed_endian_specific_integral;
311 using aligned_ubig32_t =
312 detail::packed_endian_specific_integral;
313 using aligned_ubig64_t =
314 detail::packed_endian_specific_integral;
315
316 using aligned_big16_t =
317 detail::packed_endian_specific_integral;
318 using aligned_big32_t =
319 detail::packed_endian_specific_integral;
320 using aligned_big64_t =
321 detail::packed_endian_specific_integral;
322
323 using unaligned_uint16_t =
324 detail::packed_endian_specific_integral;
325 using unaligned_uint32_t =
326 detail::packed_endian_specific_integral;
327 using unaligned_uint64_t =
328 detail::packed_endian_specific_integral;
329
330 using unaligned_int16_t =
331 detail::packed_endian_specific_integral;
332 using unaligned_int32_t =
333 detail::packed_endian_specific_integral;
334 using unaligned_int64_t =
335 detail::packed_endian_specific_integral;
325336
326337 namespace endian {
338
327339 template inline T read(const void *P, endianness E) {
328340 return read(P, E);
329341 }
393405 inline void write16be(void *P, uint16_t V) { write16(P, V); }
394406 inline void write32be(void *P, uint32_t V) { write32(P, V); }
395407 inline void write64be(void *P, uint64_t V) { write64(P, V); }
408
396409 } // end namespace endian
410
397411 } // end namespace support
398412 } // end namespace llvm
399413
400 #endif
414 #endif // LLVM_SUPPORT_ENDIAN_H
None //===----- llvm/Support/Error.h - Recoverable error handling ----*- C++ -*-===//
0 //===- llvm/Support/Error.h - Recoverable error handling --------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1313 #ifndef LLVM_SUPPORT_ERROR_H
1414 #define LLVM_SUPPORT_ERROR_H
1515
16 #include "llvm/ADT/SmallVector.h"
1617 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/ADT/SmallVector.h"
1818 #include "llvm/ADT/StringExtras.h"
1919 #include "llvm/ADT/Twine.h"
2020 #include "llvm/Config/abi-breaking.h"
2121 #include "llvm/Support/AlignOf.h"
2222 #include "llvm/Support/Compiler.h"
2323 #include "llvm/Support/Debug.h"
24 #include "llvm/Support/ErrorHandling.h"
2425 #include "llvm/Support/ErrorOr.h"
2526 #include "llvm/Support/raw_ostream.h"
2627 #include
166167
167168 protected:
168169 /// Create a success value. Prefer using 'Error::success()' for readability
169 Error() : Payload(nullptr) {
170 Error() {
170171 setPtr(nullptr);
171172 setChecked(false);
172173 }
181182 /// Move-construct an error value. The newly constructed error is considered
182183 /// unchecked, even if the source error had been checked. The original error
183184 /// becomes a checked Success value, regardless of its original state.
184 Error(Error &&Other) : Payload(nullptr) {
185 Error(Error &&Other) {
185186 setChecked(true);
186187 *this = std::move(Other);
187188 }
298299 return Tmp;
299300 }
300301
301 ErrorInfoBase *Payload;
302 ErrorInfoBase *Payload = nullptr;
302303 };
303304
304305 /// Subclass of Error for the sole purpose of identifying the success path in
326327 template
327328 class ErrorInfo : public ParentErrT {
328329 public:
329
330330 static const void *classID() { return &ThisErrT::ID; }
331331
332332 const void *dynamicClassID() const override { return &ThisErrT::ID; }
644644 template class LLVM_NODISCARD Expected {
645645 template friend class ExpectedAsOutParameter;
646646 template friend class Expected;
647
647648 static const bool isRef = std::is_reference::value;
648 typedef ReferenceStorage::type> wrap;
649
650 typedef std::unique_ptr error_type;
651
652 public:
653 typedef typename std::conditional::type storage_type;
654 typedef T value_type;
649
650 using wrap = ReferenceStorage::type>;
651
652 using error_type = std::unique_ptr;
653
654 public:
655 using storage_type = typename std::conditional::type;
656 using value_type = T;
655657
656658 private:
657 typedef typename std::remove_reference::type &reference;
658 typedef const typename std::remove_reference::type &const_reference;
659 typedef typename std::remove_reference::type *pointer;
660 typedef const typename std::remove_reference::type *const_pointer;
659 using reference = typename std::remove_reference::type &;
660 using const_reference = const typename std::remove_reference::type &;
661 using pointer = typename std::remove_reference::type *;
662 using const_pointer = const typename std::remove_reference::type *;
661663
662664 public:
663665 /// Create an Expected error value from the given Error.
890892 template
891893 class ExpectedAsOutParameter {
892894 public:
893
894895 ExpectedAsOutParameter(Expected *ValOrErr)
895896 : ValOrErr(ValOrErr) {
896897 if (ValOrErr)
1515 #ifndef LLVM_SUPPORT_ERROROR_H
1616 #define LLVM_SUPPORT_ERROROR_H
1717
18 #include "llvm/ADT/PointerIntPair.h"
1918 #include "llvm/Support/AlignOf.h"
2019 #include
2120 #include
2221 #include
22 #include
2323
2424 namespace llvm {
25
2526 /// \brief Stores a reference that can be changed.
2627 template
2728 class ReferenceStorage {
6667 template
6768 class ErrorOr {
6869 template friend class ErrorOr;
70
6971 static const bool isRef = std::is_reference::value;
70 typedef ReferenceStorage::type> wrap;
72
73 using wrap = ReferenceStorage::type>;
7174
7275 public:
73 typedef typename std::conditional::type storage_type;
76 using storage_type = typename std::conditional::type;
7477
7578 private:
76 typedef typename std::remove_reference::type &reference;
77 typedef const typename std::remove_reference::type &const_reference;
78 typedef typename std::remove_reference::type *pointer;
79 typedef const typename std::remove_reference::type *const_pointer;
79 using reference = typename std::remove_reference::type &;
80 using const_reference = const typename std::remove_reference::type &;
81 using pointer = typename std::remove_reference::type *;
82 using const_pointer = const typename std::remove_reference::type *;
8083
8184 public:
8285 template
281284 operator==(const ErrorOr &Err, E Code) {
282285 return Err.getError() == Code;
283286 }
287
284288 } // end namespace llvm
285289
286290 #endif // LLVM_SUPPORT_ERROROR_H
4848 /// Clients that want to handle their own diagnostics in a custom way can
4949 /// register a function pointer+context as a diagnostic handler.
5050 /// It gets called each time PrintMessage is invoked.
51 typedef void (*DiagHandlerTy)(const SMDiagnostic &, void *Context);
51 using DiagHandlerTy = void (*)(const SMDiagnostic &, void *Context);
5252
5353 private:
5454 struct SrcBuffer {
None //===-- StringPool.h - Interned string pool ---------------------*- C++ -*-===//
0 //===- StringPool.h - Interned string pool ----------------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
2929 #define LLVM_SUPPORT_STRINGPOOL_H
3030
3131 #include "llvm/ADT/StringMap.h"
32 #include "llvm/ADT/StringRef.h"
3233 #include
3334
3435 namespace llvm {
4243 /// PooledString - This is the value of an entry in the pool's interning
4344 /// table.
4445 struct PooledString {
45 StringPool *Pool; ///< So the string can remove itself.
46 unsigned Refcount; ///< Number of referencing PooledStringPtrs.
46 StringPool *Pool = nullptr; ///< So the string can remove itself.
47 unsigned Refcount = 0; ///< Number of referencing PooledStringPtrs.
4748
4849 public:
49 PooledString() : Pool(nullptr), Refcount(0) { }
50 PooledString() = default;
5051 };
5152
5253 friend class PooledStringPtr;
5354
54 typedef StringMap table_t;
55 typedef StringMapEntry entry_t;
55 using table_t = StringMap;
56 using entry_t = StringMapEntry;
5657 table_t InternTable;
5758
5859 public:
7576 /// a single pointer, but it does have reference-counting overhead when
7677 /// copied.
7778 class PooledStringPtr {
78 typedef StringPool::entry_t entry_t;
79 entry_t *S;
79 using entry_t = StringPool::entry_t;
80
81 entry_t *S = nullptr;
8082
8183 public:
82 PooledStringPtr() : S(nullptr) {}
84 PooledStringPtr() = default;
8385
8486 explicit PooledStringPtr(entry_t *E) : S(E) {
8587 if (S) ++S->getValue().Refcount;
132134 inline bool operator!=(const PooledStringPtr &That) const { return S != That.S; }
133135 };
134136
135 } // End llvm namespace
137 } // end namespace llvm
136138
137 #endif
139 #endif // LLVM_SUPPORT_STRINGPOOL_H
1313 #ifndef LLVM_SUPPORT_TYPE_TRAITS_H
1414 #define LLVM_SUPPORT_TYPE_TRAITS_H
1515
16 #include "llvm/Support/Compiler.h"
1617 #include
1718 #include
18
19 #include "llvm/Support/Compiler.h"
2019
2120 #ifndef __has_feature
2221 #define LLVM_DEFINED_HAS_FEATURE
5049
5150 // std::pair's are pod-like if their elements are.
5251 template
53 struct isPodLike > {
52 struct isPodLike> {
5453 static const bool value = isPodLike::value && isPodLike::value;
5554 };
5655
6261 /// Also note that enum classes aren't implicitly convertible to integral types,
6362 /// the value may therefore need to be explicitly converted before being used.
6463 template class is_integral_or_enum {
65 typedef typename std::remove_reference::type UnderlyingT;
64 using UnderlyingT = typename std::remove_reference::type;
6665
6766 public:
6867 static const bool value =
7574
7675 /// \brief If T is a pointer, just return it. If it is not, return T&.
7776 template
78 struct add_lvalue_reference_if_not_pointer { typedef T &type; };
77 struct add_lvalue_reference_if_not_pointer { using type = T &; };
7978
8079 template
8180 struct add_lvalue_reference_if_not_pointer<
8281 T, typename std::enable_if::value>::type> {
83 typedef T type;
82 using type = T;
8483 };
8584
8685 /// \brief If T is a pointer to X, return a pointer to const X. If it is not,
8786 /// return const T.
8887 template
89 struct add_const_past_pointer { typedef const T type; };
88 struct add_const_past_pointer { using type = const T; };
9089
9190 template
9291 struct add_const_past_pointer<
9392 T, typename std::enable_if::value>::type> {
94 typedef const typename std::remove_pointer::type *type;
93 using type = const typename std::remove_pointer::type *;
9594 };
9695
9796 template
103102 T, typename std::enable_if::value>::type> {
104103 using type = typename add_const_past_pointer::type;
105104 };
106 }
105
106 } // end namespace llvm
107107
108108 // If the compiler supports detecting whether a class is final, define
109109 // an LLVM_IS_FINAL macro. If it cannot be defined properly, this
118118 #undef __has_feature
119119 #endif
120120
121 #endif
121 #endif // LLVM_SUPPORT_TYPE_TRAITS_H
None //===-- ELFDumper.cpp - ELF-specific dumper ---------------------*- C++ -*-===//
0 //===- ELFDumper.cpp - ELF-specific dumper --------------------------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1616 #include "ObjDumper.h"
1717 #include "StackMapPrinter.h"
1818 #include "llvm-readobj.h"
19 #include "llvm/ADT/ArrayRef.h"
1920 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/PointerIntPair.h"
2022 #include "llvm/ADT/SmallString.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/ADT/STLExtras.h"
2125 #include "llvm/ADT/StringExtras.h"
26 #include "llvm/ADT/StringRef.h"
27 #include "llvm/ADT/Twine.h"
28 #include "llvm/BinaryFormat/ELF.h"
29 #include "llvm/Object/ELF.h"
2230 #include "llvm/Object/ELFObjectFile.h"
31 #include "llvm/Object/ELFTypes.h"
32 #include "llvm/Object/Error.h"
33 #include "llvm/Object/ObjectFile.h"
34 #include "llvm/Object/StackMapParser.h"
2335 #include "llvm/Support/ARMAttributeParser.h"
2436 #include "llvm/Support/ARMBuildAttributes.h"
37 #include "llvm/Support/Casting.h"
2538 #include "llvm/Support/Compiler.h"
39 #include "llvm/Support/Endian.h"
40 #include "llvm/Support/ErrorHandling.h"
2641 #include "llvm/Support/Format.h"
2742 #include "llvm/Support/FormattedStream.h"
2843 #include "llvm/Support/MathExtras.h"
2944 #include "llvm/Support/MipsABIFlags.h"
3045 #include "llvm/Support/ScopedPrinter.h"
3146 #include "llvm/Support/raw_ostream.h"
47 #include
48 #include
49 #include
50 #include
51 #include
52 #include
53 #include
54 #include
55 #include
56 #include
3257
3358 using namespace llvm;
3459 using namespace llvm::object;
4873 return std::string(#enum).substr(3);
4974
5075 #define TYPEDEF_ELF_TYPES(ELFT) \
51 typedef ELFFile ELFO; \
52 typedef typename ELFO::Elf_Shdr Elf_Shdr; \
53 typedef typename ELFO::Elf_Sym Elf_Sym; \
54 typedef typename ELFO::Elf_Dyn Elf_Dyn; \
55 typedef typename ELFO::Elf_Dyn_Range Elf_Dyn_Range; \
56 typedef typename ELFO::Elf_Rel Elf_Rel; \
57 typedef typename ELFO::Elf_Rela Elf_Rela; \
58 typedef typename ELFO::Elf_Rel_Range Elf_Rel_Range; \
59 typedef typename ELFO::Elf_Rela_Range Elf_Rela_Range; \
60 typedef typename ELFO::Elf_Phdr Elf_Phdr; \
61 typedef typename ELFO::Elf_Half Elf_Half; \
62 typedef typename ELFO::Elf_Ehdr Elf_Ehdr; \
63 typedef typename ELFO::Elf_Word Elf_Word; \
64 typedef typename ELFO::Elf_Hash Elf_Hash; \
65 typedef typename ELFO::Elf_GnuHash Elf_GnuHash; \
66 typedef typename ELFO::Elf_Sym_Range Elf_Sym_Range; \
67 typedef typename ELFO::Elf_Versym Elf_Versym; \
68 typedef typename ELFO::Elf_Verneed Elf_Verneed; \
69 typedef typename ELFO::Elf_Vernaux Elf_Vernaux; \
70 typedef typename ELFO::Elf_Verdef Elf_Verdef; \
71 typedef typename ELFO::Elf_Verdaux Elf_Verdaux; \
72 typedef typename ELFO::uintX_t uintX_t;
76 using ELFO = ELFFile; \
77 using Elf_Shdr = typename ELFO::Elf_Shdr; \
78 using Elf_Sym = typename ELFO::Elf_Sym; \
79 using Elf_Dyn = typename ELFO::Elf_Dyn; \
80 using Elf_Dyn_Range = typename ELFO::Elf_Dyn_Range; \
81 using Elf_Rel = typename ELFO::Elf_Rel; \
82 using Elf_Rela = typename ELFO::Elf_Rela; \
83 using Elf_Rel_Range = typename ELFO::Elf_Rel_Range; \
84 using Elf_Rela_Range = typename ELFO::Elf_Rela_Range; \
85 using Elf_Phdr = typename ELFO::Elf_Phdr; \
86 using Elf_Half = typename ELFO::Elf_Half; \
87 using Elf_Ehdr = typename ELFO::Elf_Ehdr; \
88 using Elf_Word = typename ELFO::Elf_Word; \
89 using Elf_Hash = typename ELFO::Elf_Hash; \
90 using Elf_GnuHash = typename ELFO::Elf_GnuHash; \
91 using Elf_Sym_Range = typename ELFO::Elf_Sym_Range; \
92 using Elf_Versym = typename ELFO::Elf_Versym; \
93 using Elf_Verneed = typename ELFO::Elf_Verneed; \
94 using Elf_Vernaux = typename ELFO::Elf_Vernaux; \
95 using Elf_Verdef = typename ELFO::Elf_Verdef; \
96 using Elf_Verdaux = typename ELFO::Elf_Verdaux; \
97 using uintX_t = typename ELFO::uintX_t;
7398
7499 namespace {
75100
80105 /// the size, entity size and virtual address are different entries in arbitrary
81106 /// order (DT_REL, DT_RELSZ, DT_RELENT for example).
82107 struct DynRegionInfo {
83 DynRegionInfo() : Addr(nullptr), Size(0), EntSize(0) {}
108 DynRegionInfo() = default;
84109 DynRegionInfo(const void *A, uint64_t S, uint64_t ES)
85110 : Addr(A), Size(S), EntSize(ES) {}
111
86112 /// \brief Address in current address space.
87 const void *Addr;
113 const void *Addr = nullptr;
88114 /// \brief Size in bytes of the region.
89 uint64_t Size;
115 uint64_t Size = 0;
90116 /// \brief Size of each entity in the region.
91 uint64_t EntSize;
117 uint64_t EntSize = 0;
92118
93119 template ArrayRef getAsArrayRef() const {
94120 const Type *Start = reinterpret_cast(Addr);
138164
139165 private:
140166 std::unique_ptr> ELFDumperStyle;
167
141168 TYPEDEF_ELF_TYPES(ELFT)
142169
143170 DynRegionInfo checkDRI(DynRegionInfo DRI) {
195222 : PointerIntPair(verdef, 0) {}
196223 VersionMapEntry(const Elf_Vernaux *vernaux)
197224 : PointerIntPair(vernaux, 1) {}
225
198226 bool isNull() const { return getPointer() == nullptr; }
199227 bool isVerdef() const { return !isNull() && getInt() == 0; }
200228 bool isVernaux() const { return !isNull() && getInt() == 1; }
261289 template class DumpStyle {
262290 public:
263291 using Elf_Shdr = typename ELFFile::Elf_Shdr;
264 using Elf_Sym = typename ELFFile::Elf_Sym;
292 using Elf_Sym = typename ELFFile::Elf_Sym;
265293
266294 DumpStyle(ELFDumper *Dumper) : Dumper(Dumper) {}
267 virtual ~DumpStyle() {}
295 virtual ~DumpStyle() = default;
296
268297 virtual void printFileHeaders(const ELFFile *Obj) = 0;
269298 virtual void printGroupSections(const ELFFile *Obj) = 0;
270299 virtual void printRelocations(const ELFFile *Obj) = 0;
273302 virtual void printDynamicSymbols(const ELFFile *Obj) = 0;
274303 virtual void printDynamicRelocations(const ELFFile *Obj) = 0;
275304 virtual void printSymtabMessage(const ELFFile *obj, StringRef Name,
276 size_t Offset) {
277 return;
278 }
305 size_t Offset) {}
279306 virtual void printSymbol(const ELFFile *Obj, const Elf_Sym *Symbol,
280307 const Elf_Sym *FirstSym, StringRef StrTable,
281308 bool IsDynamic) = 0;
283310 virtual void printHashHistogram(const ELFFile *Obj) = 0;
284311 virtual void printNotes(const ELFFile *Obj) = 0;
285312 const ELFDumper *dumper() const { return Dumper; }
313
286314 private:
287315 const ELFDumper *Dumper;
288316 };
289317
290318 template class GNUStyle : public DumpStyle {
291319 formatted_raw_ostream OS;
320
292321 public:
293322 TYPEDEF_ELF_TYPES(ELFT)
323
294324 GNUStyle(ScopedPrinter &W, ELFDumper *Dumper)
295325 : DumpStyle(Dumper), OS(W.getOStream()) {}
326
296327 void printFileHeaders(const ELFO *Obj) override;
297328 void printGroupSections(const ELFFile *Obj) override;
298329 void printRelocations(const ELFO *Obj) override;
300331 void printSymbols(const ELFO *Obj) override;
301332 void printDynamicSymbols(const ELFO *Obj) override;
302333 void printDynamicRelocations(const ELFO *Obj) override;
303 virtual void printSymtabMessage(const ELFO *Obj, StringRef Name,
304 size_t Offset) override;
334 void printSymtabMessage(const ELFO *Obj, StringRef Name,
335 size_t Offset) override;
305336 void printProgramHeaders(const ELFO *Obj) override;
306337 void printHashHistogram(const ELFFile *Obj) override;
307338 void printNotes(const ELFFile *Obj) override;
310341 struct Field {
311342 StringRef Str;
312343 unsigned Column;
344
313345 Field(StringRef S, unsigned Col) : Str(S), Column(Col) {}
314346 Field(unsigned Col) : Str(""), Column(Col) {}
315347 };
347379 template class LLVMStyle : public DumpStyle {
348380 public:
349381 TYPEDEF_ELF_TYPES(ELFT)
382
350383 LLVMStyle(ScopedPrinter &W, ELFDumper *Dumper)
351384 : DumpStyle(Dumper), W(W) {}
352385
367400 void printDynamicRelocation(const ELFO *Obj, Elf_Rela Rel);
368401 void printSymbol(const ELFO *Obj, const Elf_Sym *Symbol, const Elf_Sym *First,
369402 StringRef StrTable, bool IsDynamic) override;
403
370404 ScopedPrinter &W;
371405 };
372406
373 } // namespace
407 } // end anonymous namespace
374408
375409 namespace llvm {
376410
404438 return readobj_error::unsupported_obj_file_format;
405439 }
406440
407 } // namespace llvm
441 } // end namespace llvm
408442
409443 // Iterate through the versions needed section, and place each Elf_Vernaux
410444 // in the VersionMap according to its index.
524558 const ELFO *Obj,
525559 const typename ELFO::Elf_Shdr *Sec,
526560 ScopedPrinter &W) {
527 typedef typename ELFO::Elf_Verdef VerDef;
528 typedef typename ELFO::Elf_Verdaux VerdAux;
561 using VerDef = typename ELFO::Elf_Verdef;
562 using VerdAux = typename ELFO::Elf_Verdaux;
529563
530564 DictScope SD(W, "SHT_GNU_verdef");
531565 if (!Sec)
580614 const ELFO *Obj,
581615 const typename ELFO::Elf_Shdr *Sec,
582616 ScopedPrinter &W) {
583 typedef typename ELFO::Elf_Verneed VerNeed;
584 typedef typename ELFO::Elf_Vernaux VernAux;
617 using VerNeed = typename ELFO::Elf_Verneed;
618 using VernAux = typename ELFO::Elf_Vernaux;
585619
586620 DictScope SD(W, "SHT_GNU_verneed");
587621 if (!Sec)
12371271 template
12381272 ELFDumper::ELFDumper(const ELFFile *Obj, ScopedPrinter &Writer)
12391273 : ObjDumper(Writer), Obj(Obj) {
1240
12411274 SmallVector LoadSegments;
12421275 for (const Elf_Phdr &Phdr : unwrapOrError(Obj->program_headers())) {
12431276 if (Phdr.p_type == ELF::PT_DYNAMIC) {
15661599
15671600 template
15681601 void printFlags(T Value, ArrayRef> Flags, raw_ostream &OS) {
1569 typedef EnumEntry FlagEntry;
1570 typedef SmallVector FlagVector;
1602 using FlagEntry = EnumEntry;
1603 using FlagVector = SmallVector;
15711604 FlagVector SetFlags;
15721605
15731606 for (const auto &Flag : Flags) {
16861719 }
16871720
16881721 namespace {
1722
16891723 template <> void ELFDumper>::printUnwindInfo() {
16901724 const unsigned Machine = Obj->getHeader()->e_machine;
16911725 if (Machine == EM_ARM) {
16951729 }
16961730 W.startLine() << "UnwindInfo not implemented.\n";
16971731 }
1698 }
1732
1733 } // end anonymous namespace
16991734
17001735 template
17011736 void ELFDumper::printDynamicTable() {
17411776 void ELFDumper::printNeededLibraries() {
17421777 ListScope D(W, "NeededLibraries");
17431778
1744 typedef std::vector LibsTy;
1779 using LibsTy = std::vector;
17451780 LibsTy Libs;
17461781
17471782 for (const auto &Entry : dynamic_table())
17951830 }
17961831
17971832 namespace {
1833
17981834 template <> void ELFDumper>::printAttributes() {
17991835 if (Obj->getHeader()->e_machine != EM_ARM) {
18001836 W.startLine() << "Attributes not implemented.\n";
18201856 ARMAttributeParser(&W).Parse(Contents, true);
18211857 }
18221858 }
1823 }
1824
1825 namespace {
1859
18261860 template class MipsGOTParser {
18271861 public:
18281862 TYPEDEF_ELF_TYPES(ELFT)
1829 typedef typename ELFO::Elf_Addr GOTEntry;
1863 using GOTEntry = typename ELFO::Elf_Addr;
1864
18301865 MipsGOTParser(ELFDumper *Dumper, const ELFO *Obj,
18311866 Elf_Dyn_Range DynTable, ScopedPrinter &W);
18321867
18371872 ELFDumper *Dumper;
18381873 const ELFO *Obj;
18391874 ScopedPrinter &W;
1840 llvm::Optional DtPltGot;
1841 llvm::Optional DtLocalGotNum;
1842 llvm::Optional DtGotSym;
1843 llvm::Optional DtMipsPltGot;
1844 llvm::Optional DtJmpRel;
1875 Optional DtPltGot;
1876 Optional DtLocalGotNum;
1877 Optional DtGotSym;
1878 Optional DtMipsPltGot;
1879 Optional DtJmpRel;
18451880
18461881 std::size_t getGOTTotal(ArrayRef GOT) const;
18471882 const GOTEntry *makeGOTIter(ArrayRef GOT, std::size_t EntryNum);
18571892 const GOTEntry *It, StringRef StrTable,
18581893 const Elf_Sym *Sym);
18591894 };
1860 }
1895
1896 } // end anonymous namespace
18611897
18621898 template
18631899 MipsGOTParser::MipsGOTParser(ELFDumper *Dumper, const ELFO *Obj,
23282364 ArrayRef StackMapContentsArray =
23292365 unwrapOrError(Obj->getSectionContents(StackMapSection));
23302366
2331 prettyPrintStackMap(llvm::outs(), StackMapV2Parser(
2332 StackMapContentsArray));
2367 prettyPrintStackMap(outs(), StackMapV2Parser(
2368 StackMapContentsArray));
23332369 }
23342370
23352371 template void ELFDumper::printGroupSections() {
24302466 template
24312467 void GNUStyle::printRelocation(const ELFO *Obj, const Elf_Shdr *SymTab,
24322468 const Elf_Rela &R, bool IsRela) {
2433 std::string Offset, Info, Addend = "", Value;
2469 std::string Offset, Info, Addend, Value;
24342470 SmallString<32> RelocName;
24352471 StringRef StrTable = unwrapOrError(Obj->getStringTableForSymtab(*SymTab));
24362472 StringRef TargetName;
25242560
25252561 std::string getSectionTypeString(unsigned Arch, unsigned Type) {
25262562 using namespace ELF;
2563
25272564 switch (Arch) {
25282565 case EM_ARM:
25292566 switch (Type) {
26902727 template
26912728 void GNUStyle::printSymtabMessage(const ELFO *Obj, StringRef Name,
26922729 size_t Entries) {
2693 if (Name.size())
2730 if (!Name.empty())
26942731 OS << "\nSymbol table '" << Name << "' contains " << Entries
26952732 << " entries:\n";
26962733 else
28452882
28462883 template
28472884 void GNUStyle::printDynamicSymbols(const ELFO *Obj) {
2848 if (this->dumper()->getDynamicStringTable().size() == 0)
2885 if (this->dumper()->getDynamicStringTable().empty())
28492886 return;
28502887 auto StringTable = this->dumper()->getDynamicStringTable();
28512888 auto DynSyms = this->dumper()->dynamic_symbols();
30593096 Obj->getRelocationTypeName(R.getType(Obj->isMips64EL()), RelocName);
30603097 SymbolName =
30613098 unwrapOrError(Sym->getName(this->dumper()->getDynamicStringTable()));
3062 std::string Addend = "", Info, Offset, Value;
3099 std::string Addend, Info, Offset, Value;
30633100 Offset = to_string(format_hex_no_prefix(R.r_offset, Width));
30643101 Info = to_string(format_hex_no_prefix(R.r_info, Width));
30653102 Value = to_string(format_hex_no_prefix(Sym->getValue(), Width));
30663103 int64_t RelAddend = R.r_addend;
3067 if (SymbolName.size() && IsRela) {
3104 if (!SymbolName.empty() && IsRela) {
30683105 if (R.r_addend < 0)
30693106 Addend = " - ";
30703107 else
30713108 Addend = " + ";
30723109 }
30733110
3074 if (!SymbolName.size() && Sym->getValue() == 0)
3111 if (SymbolName.empty() && Sym->getValue() == 0)
30753112 Value = "";
30763113
30773114 if (IsRela)
32063243 size_t MaxChain = 1;
32073244 size_t CumulativeNonZero = 0;
32083245
3209 if (Chains.size() == 0 || NBucket == 0)
3246 if (Chains.empty() || NBucket == 0)
32103247 return;
32113248
32123249 std::vector ChainLen(NBucket, 0);
35373574 DictScope Group(W, "Relocation");
35383575 W.printHex("Offset", Rel.r_offset);
35393576 W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL()));
3540 W.printNumber("Symbol", TargetName.size() > 0 ? TargetName : "-",
3577 W.printNumber("Symbol", !TargetName.empty() ? TargetName : "-",
35413578 Rel.getSymbol(Obj->isMips64EL()));
35423579 W.printHex("Addend", Rel.r_addend);
35433580 } else {
35443581 raw_ostream &OS = W.startLine();
35453582 OS << W.hex(Rel.r_offset) << " " << RelocName << " "
3546 << (TargetName.size() > 0 ? TargetName : "-") << " "
3583 << (!TargetName.empty() ? TargetName : "-") << " "
35473584 << W.hex(Rel.r_addend) << "\n";
35483585 }
35493586 }
37343771 DictScope Group(W, "Relocation");
37353772 W.printHex("Offset", Rel.r_offset);
37363773 W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL()));
3737 W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-");
3774 W.printString("Symbol", !SymbolName.empty() ? SymbolName : "-");
37383775 W.printHex("Addend", Rel.r_addend);
37393776 } else {
37403777 raw_ostream &OS = W.startLine();
37413778 OS << W.hex(Rel.r_offset) << " " << RelocName << " "
3742 << (SymbolName.size() > 0 ? SymbolName : "-") << " "
3779 << (!SymbolName.empty() ? SymbolName : "-") << " "
37433780 << W.hex(Rel.r_addend) << "\n";
37443781 }
37453782 }
37723809 void LLVMStyle::printNotes(const ELFFile *Obj) {
37733810 W.startLine() << "printNotes not implemented!\n";
37743811 }
3775