OSDN Git Service

TargetParser: FPU/ARCH/EXT parsing refactory - NFC
authorRenato Golin <renato.golin@linaro.org>
Fri, 8 May 2015 21:04:27 +0000 (21:04 +0000)
committerRenato Golin <renato.golin@linaro.org>
Fri, 8 May 2015 21:04:27 +0000 (21:04 +0000)
commita54f2b87f7aef3dc70575fe9b5329a4322c94b0a
treec3ae075b1a98826ad9de92d59951ede6b5f11527
parentd4f7f2927724822212179c2becfdb63d1a46c1c4
TargetParser: FPU/ARCH/EXT parsing refactory - NFC

This new class in a global context contain arch-specific knowledge in order
to provide LLVM libraries, tools and projects with the ability to understand
the architectures. For now, only FPU, ARCH and ARCH extensions on ARM are
supported.

Current behaviour it to parse from free-text to enum values and back, so that
all users can share the same parser and codes. This simplifies a lot both the
ASM/Obj streamers in the back-end (where this came from), and the front-end
parsers for command line arguments (where this is going to be used next).

The previous implementation, using .def/.h includes is deprecated due to its
inflexibility to be built without the backend support and for being too
cumbersome. As more architectures join this scheme, and as more features of
such architectures are added (such as hardware features, type sizes, etc) into
a full blown TargetDescription class, having a set of classes is the most
sane implementation.

The ultimate goal of this refactor both LLVM's and Clang's target description
classes into one unique interface, so that we can de-duplicate and standardise
the descriptions, as well as make it available for other front-ends, tools,
etc.

The FPU parsing for command line options in Clang has been converted to use
this new library and a number of aliases were added for compatibility:
 * A bogus neon-vfpv3 alias (neon defaults to vfp3)
 * armv5/v6
 * {fp4/fp5}-{sp/dp}-d16

Next steps:
 * Port Clang's ARCH/EXT parsing to use this library.
 * Create a TableGen back-end to generate this information.
 * Run this TableGen process regardless of which back-ends are built.
 * Expose more information and rename it to TargetDescription.
 * Continue re-factoring Clang to use as much of it as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236900 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/Support/TargetParser.h [new file with mode: 0644]
lib/Support/CMakeLists.txt
lib/Support/TargetParser.cpp [new file with mode: 0644]
lib/Support/Triple.cpp
lib/Target/ARM/ARMArchExtName.def [deleted file]
lib/Target/ARM/ARMArchExtName.h [deleted file]
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMFPUName.def [deleted file]
lib/Target/ARM/ARMFPUName.h [deleted file]
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/ARM/MCTargetDesc/ARMArchName.def [deleted file]
lib/Target/ARM/MCTargetDesc/ARMArchName.h [deleted file]
lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp