[PATCH] D26332: Add a user-defined literal for StringRef

Malcolm Parsons via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 01:02:36 PST 2016


malcolm.parsons created this revision.
malcolm.parsons added reviewers: mehdi_amini, dexonsmith, zturner, pete.
malcolm.parsons added a subscriber: llvm-commits.
Herald added subscribers: nemanjai, jholewinski.

User-defined literals are supported by GCC 4.7, Clang 3.1 and MSVC 2015.

A user-defined literal for StringRef makes it easy to create StringRefs
containing embedded nulls.
It is also constexpr, so global tables of StringRef don't need a static
initializer.

Inspired by https://reviews.llvm.org/D25639.


https://reviews.llvm.org/D26332

Files:
  include/llvm/ADT/StringRef.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/AsmPrinter/DIEHash.cpp
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  lib/CodeGen/TargetPassConfig.cpp
  lib/IR/Value.cpp
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCDwarf.cpp
  lib/MC/MCParser/AsmParser.cpp
  lib/Object/MachOObjectFile.cpp
  lib/Support/GraphWriter.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
  lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  lib/Target/PowerPC/PPCAsmPrinter.cpp
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/X86/X86AsmPrinter.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86MCInstLower.cpp
  lib/Target/XCore/XCoreAsmPrinter.cpp
  lib/Transforms/Instrumentation/AddressSanitizer.cpp
  lib/Transforms/Instrumentation/MemorySanitizer.cpp
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  lib/Transforms/Instrumentation/SanitizerCoverage.cpp
  tools/dsymutil/MachOUtils.cpp
  tools/dsymutil/dsymutil.cpp
  tools/llvm-pdbdump/LLVMOutputStyle.cpp
  tools/llvm-readobj/ARMAttributeParser.cpp
  tools/llvm-readobj/ARMEHABIPrinter.h
  tools/llvm-readobj/COFFDumper.cpp
  tools/llvm-readobj/ELFDumper.cpp
  tools/llvm-readobj/Win64EHDumper.cpp
  unittests/ADT/APIntTest.cpp
  unittests/ADT/STLExtrasTest.cpp
  unittests/ADT/StringRefTest.cpp
  unittests/ADT/StringSwitchTest.cpp
  unittests/ADT/TwineTest.cpp
  unittests/Bitcode/BitstreamWriterTest.cpp
  unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
  unittests/IR/DebugInfoTest.cpp
  unittests/IR/MDBuilderTest.cpp
  unittests/ProfileData/InstrProfTest.cpp
  unittests/Support/CompressionTest.cpp
  unittests/Support/ConvertUTFTest.cpp
  unittests/Support/DwarfTest.cpp
  unittests/Support/Path.cpp
  unittests/Support/TargetParserTest.cpp
  unittests/Support/YAMLIOTest.cpp
  utils/FileCheck/FileCheck.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26332.76984.patch
Type: text/x-patch
Size: 63419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161106/964c7231/attachment-0001.bin>


More information about the llvm-commits mailing list