Go to file
Richard Smith 8a57f2e012 Move Itanium demangler implementation into a header file and add visitation support.
Summary:
This transforms the Itanium demangler into a generic reusable library that can
be used to build, traverse, and transform Itanium mangled name trees.

This is in preparation for adding a canonicalizing demangler, which
cannot live in the Demangle library for layering reasons. In order to
keep the diffs simpler, this patch moves more code to the new header
than is strictly necessary: in particular, all of the printLeft /
printRight implementations can be moved to the implementation file.
(And indeed we could make them non-virtual now if we wished, and remove
the vptr from Node.)

All nodes are now included in the Kind enumeration, rather than omitting
some of the Expr nodes, and the three different floating-point literal
node types now have distinct Kind values.

As a proof of concept for the visitation / matching mechanism, this
patch implements a Node dumping facility on top of it, replacing the
prior mechanism that produced the pretty-printed output rather than a
tree dump. Sample dump output:

FunctionEncoding(
  NameType("int"),
  NameWithTemplateArgs(
    NestedName(
      NameWithTemplateArgs(
        NameType("A"),
        TemplateArgs(
          {NameType("B")})),
      NameType("f")),
    TemplateArgs(
      {NameType("int")})),
  {},
  <null>,
  QualConst, FunctionRefQual::FrefQualLValue)

As a next step, it would make sense to move the LLVM high-level interface to
the demangler (the itaniumDemangler function and ItaniumPartialDemangler class)
into the Support library, and implement them in terms of the Demangle library.
This would allow the libc++abi demangler implementation to be an identical copy
of the llvm Demangle library, and would allow the LLVM implementation to reuse
LLVM components such as llvm::BumpPtrAllocator, but we'll need to decide how to
coordinate that with the MS ABI demangler, so I'm not doing that in this patch.

No functionality change intended other than the behavior of dump().

Reviewers: erik.pilkington, zturner, chandlerc, dlj

Subscribers: aheejin, llvm-commits

Differential Revision: https://reviews.llvm.org/D50930

llvm-svn: 340203
2018-08-20 19:44:01 +00:00
clang [Lex] Make HeaderMaps a unique_ptr vector 2018-08-20 19:15:02 +00:00
clang-tools-extra [clangd] DexIndex implementation prototype 2018-08-20 14:39:32 +00:00
compiler-rt [sanitizer] Use private futex operations for BlockingMutex 2018-08-20 14:57:58 +00:00
debuginfo-tests (Retry) Add a basic integration test for C++ smart pointers 2018-08-20 17:17:38 +00:00
libclc amdgcn: Use __constant AS for amdgcn builtins. 2018-08-03 15:14:08 +00:00
libcxx Refactor the newly created <bit> header. Still (almost) NFC. Reviewed as https://reviews.llvm.org/D50876 2018-08-17 17:27:25 +00:00
libcxxabi Factor Node creation out of the demangler. No functionality change intended. 2018-08-16 22:04:36 +00:00
libunwind NFC: Test commit access 2018-08-16 16:55:07 +00:00
lld [LLD][ELF] - Fix warning. 2018-08-20 10:29:21 +00:00
lldb Remove manual byte counting from Opcode::Dump 2018-08-20 15:51:14 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm Move Itanium demangler implementation into a header file and add visitation support. 2018-08-20 19:44:01 +00:00
openmp [OMPT] Remove OMPT idle callback 2018-08-15 13:54:28 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [AST] Adapt Polly to AnalysisSetTracker changes. NFC. 2018-08-17 19:31:41 +00:00
README.md

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.