[PATCH] D73036: [DWARF] Make dwarf::getUnitLengthFieldByteSize() constexpr. NFC.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 05:31:00 PST 2020


ikudrin created this revision.
ikudrin added reviewers: probinson, dblaikie.
ikudrin added projects: debug-info, LLVM.

This will help make some expressions in upcoming patches also `constexpr`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73036

Files:
  llvm/include/llvm/BinaryFormat/Dwarf.h


Index: llvm/include/llvm/BinaryFormat/Dwarf.h
===================================================================
--- llvm/include/llvm/BinaryFormat/Dwarf.h
+++ llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -564,7 +564,7 @@
 };
 
 /// Get the byte size of the unit length field depending on the DWARF format.
-inline uint8_t getUnitLengthFieldByteSize(DwarfFormat Format) {
+constexpr uint8_t getUnitLengthFieldByteSize(DwarfFormat Format) {
   switch (Format) {
   case DwarfFormat::DWARF32:
     return 4;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73036.239086.patch
Type: text/x-patch
Size: 504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200120/4929f18b/attachment.bin>


More information about the llvm-commits mailing list