[llvm] r232301 - llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
David Majnemer
david.majnemer at gmail.com
Sat Mar 14 18:30:58 PDT 2015
Author: majnemer
Date: Sat Mar 14 20:30:58 2015
New Revision: 232301
URL: http://llvm.org/viewvc/llvm-project?rev=232301&view=rev
Log:
llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
llvm-vtabledump has grown enough functionality not related to vtables
that it deserves a name which is more descriptive.
Added:
llvm/trunk/test/tools/llvm-cxxdump/
llvm/trunk/test/tools/llvm-cxxdump/Inputs/
llvm/trunk/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386
- copied, changed from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386
llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386
- copied, changed from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386
llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386
- copied, changed from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386
llvm/trunk/test/tools/llvm-cxxdump/eh.test
- copied, changed from r232300, llvm/trunk/test/tools/llvm-vtabledump/eh.test
llvm/trunk/test/tools/llvm-cxxdump/trivial.test
- copied, changed from r232300, llvm/trunk/test/tools/llvm-vtabledump/trivial.test
llvm/trunk/tools/llvm-cxxdump/
llvm/trunk/tools/llvm-cxxdump/CMakeLists.txt
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt
llvm/trunk/tools/llvm-cxxdump/Error.cpp
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/Error.cpp
llvm/trunk/tools/llvm-cxxdump/Error.h
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/Error.h
llvm/trunk/tools/llvm-cxxdump/LLVMBuild.txt
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt
llvm/trunk/tools/llvm-cxxdump/Makefile
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/Makefile
llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp
llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.h
- copied, changed from r232300, llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h
Removed:
llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386
llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386
llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386
llvm/trunk/test/tools/llvm-vtabledump/eh.test
llvm/trunk/test/tools/llvm-vtabledump/trivial.test
llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt
llvm/trunk/tools/llvm-vtabledump/Error.cpp
llvm/trunk/tools/llvm-vtabledump/Error.h
llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt
llvm/trunk/tools/llvm-vtabledump/Makefile
llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp
llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h
Modified:
llvm/trunk/test/CMakeLists.txt
llvm/trunk/test/lit.cfg
llvm/trunk/tools/CMakeLists.txt
llvm/trunk/tools/Makefile
Modified: llvm/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CMakeLists.txt?rev=232301&r1=232300&r2=232301&view=diff
==============================================================================
--- llvm/trunk/test/CMakeLists.txt (original)
+++ llvm/trunk/test/CMakeLists.txt Sat Mar 14 20:30:58 2015
@@ -28,6 +28,7 @@ set(LLVM_TEST_DEPENDS
llvm-bcanalyzer
llvm-c-test
llvm-cov
+ llvm-cxxdump
llvm-diff
llvm-dis
llvm-dsymutil
@@ -46,7 +47,6 @@ set(LLVM_TEST_DEPENDS
llvm-size
llvm-symbolizer
llvm-tblgen
- llvm-vtabledump
macho-dump
opt
FileCheck
Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=232301&r1=232300&r2=232301&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Sat Mar 14 20:30:58 2015
@@ -41,7 +41,7 @@ config.test_format = lit.formats.ShTest(
# suffixes: A list of file extensions to treat as test files. This is overriden
# by individual lit.local.cfg files in the test subdirectories.
-config.suffixes = ['.ll', '.c', '.cpp', '.test', '.txt', '.s']
+config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s']
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
@@ -228,6 +228,7 @@ for pattern in [r"\bbugpoint\b(?!-)",
r"\bllvm-bcanalyzer\b",
r"\bllvm-config\b",
r"\bllvm-cov\b",
+ r"\bllvm-cxxdump\b",
r"\bllvm-diff\b",
r"\bllvm-dis\b",
r"\bllvm-dsymutil\b",
@@ -246,7 +247,6 @@ for pattern in [r"\bbugpoint\b(?!-)",
r"\bllvm-rtdyld\b",
r"\bllvm-size\b",
r"\bllvm-tblgen\b",
- r"\bllvm-vtabledump\b",
r"\bllvm-c-test\b",
r"\bmacho-dump\b",
NOJUNK + r"\bopt\b",
Copied: llvm/trunk/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386 (from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386?p2=llvm/trunk/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386&p1=llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386 (from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386?p2=llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386&p1=llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386 (from r232300, llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386?p2=llvm/trunk/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386&p1=llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/tools/llvm-cxxdump/eh.test (from r232300, llvm/trunk/test/tools/llvm-vtabledump/eh.test)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/eh.test?p2=llvm/trunk/test/tools/llvm-cxxdump/eh.test&p1=llvm/trunk/test/tools/llvm-vtabledump/eh.test&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-vtabledump/eh.test (original)
+++ llvm/trunk/test/tools/llvm-cxxdump/eh.test Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-RUN: llvm-vtabledump %p/Inputs/eh.obj.coff-i386 \
+RUN: llvm-cxxdump %p/Inputs/eh.obj.coff-i386 \
RUN: | FileCheck %s --check-prefix=COFF-I386
Copied: llvm/trunk/test/tools/llvm-cxxdump/trivial.test (from r232300, llvm/trunk/test/tools/llvm-vtabledump/trivial.test)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/trivial.test?p2=llvm/trunk/test/tools/llvm-cxxdump/trivial.test&p1=llvm/trunk/test/tools/llvm-vtabledump/trivial.test&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-vtabledump/trivial.test (original)
+++ llvm/trunk/test/tools/llvm-cxxdump/trivial.test Sat Mar 14 20:30:58 2015
@@ -1,7 +1,7 @@
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.coff-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.coff-i386 \
RUN: | FileCheck %s --check-prefix=COFF-I386
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.elf-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s --check-prefix=ELF-I386
COFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
Removed: llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386?rev=232300&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386 (original) and llvm/trunk/test/tools/llvm-vtabledump/Inputs/eh.obj.coff-i386 (removed) differ
Removed: llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386?rev=232300&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386 (original) and llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386 (removed) differ
Removed: llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386?rev=232300&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386 (original) and llvm/trunk/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386 (removed) differ
Removed: llvm/trunk/test/tools/llvm-vtabledump/eh.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/eh.test?rev=232300&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-vtabledump/eh.test (original)
+++ llvm/trunk/test/tools/llvm-vtabledump/eh.test (removed)
@@ -1,258 +0,0 @@
-RUN: llvm-vtabledump %p/Inputs/eh.obj.coff-i386 \
-RUN: | FileCheck %s --check-prefix=COFF-I386
-
-
-COFF-I386: ??_R0?AUA@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AUA@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AUA@@@8[MangledName]: .?AUA@@
-COFF-I386: ??_R0?AUB@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AUB@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AUB@@@8[MangledName]: .?AUB@@
-COFF-I386: ??_R0?AUC@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AUC@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AUC@@@8[MangledName]: .?AUC@@
-COFF-I386: ??_R0?AUM@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AUM@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AUM@@@8[MangledName]: .?AUM@@
-COFF-I386: ??_R0?AUS@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AUS@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AUS@@@8[MangledName]: .?AUS@@
-COFF-I386: ??_R0?AW4E@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0?AW4E@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0?AW4E@@@8[MangledName]: .?AW4E@@
-COFF-I386: ??_R0PAUA@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PAUA@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0PAUA@@@8[MangledName]: .PAUA@@
-COFF-I386: ??_R0PAUC@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PAUC@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0PAUC@@@8[MangledName]: .PAUC@@
-COFF-I386: ??_R0PAUS@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PAUS@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0PAUS@@@8[MangledName]: .PAUS@@
-COFF-I386: ??_R0PAW4E@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PAW4E@@@8[AlwaysZero]: 0
-COFF-I386: ??_R0PAW4E@@@8[MangledName]: .PAW4E@@
-COFF-I386: ??_R0PAX at 8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PAX at 8[AlwaysZero]: 0
-COFF-I386: ??_R0PAX at 8[MangledName]: .PAX
-COFF-I386: ??_R0PQS@@H at 8[VFPtr]: ??_7type_info@@6B@
-COFF-I386: ??_R0PQS@@H at 8[AlwaysZero]: 0
-COFF-I386: ??_R0PQS@@H at 8[MangledName]: .PQS@@H
-COFF-I386: __TI1?AW4E@@[Flags]: 0
-COFF-I386: __TI1?AW4E@@[Flags.Const]: false
-COFF-I386: __TI1?AW4E@@[Flags.Volatile]: false
-COFF-I386: __TI1?AW4E@@[CleanupFn]: null
-COFF-I386: __TI1?AW4E@@[ForwardCompat]: null
-COFF-I386: __TI1?AW4E@@[CatchableTypeArray]: __CTA1?AW4E@@
-COFF-I386: __TI1PQS@@H[Flags]: 0
-COFF-I386: __TI1PQS@@H[Flags.Const]: false
-COFF-I386: __TI1PQS@@H[Flags.Volatile]: false
-COFF-I386: __TI1PQS@@H[CleanupFn]: null
-COFF-I386: __TI1PQS@@H[ForwardCompat]: null
-COFF-I386: __TI1PQS@@H[CatchableTypeArray]: __CTA1PQS@@H
-COFF-I386: __TI2CPAW4E@@[Flags]: 1
-COFF-I386: __TI2CPAW4E@@[Flags.Const]: true
-COFF-I386: __TI2CPAW4E@@[Flags.Volatile]: false
-COFF-I386: __TI2CPAW4E@@[CleanupFn]: null
-COFF-I386: __TI2CPAW4E@@[ForwardCompat]: null
-COFF-I386: __TI2CPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
-COFF-I386: __TI2CVPAW4E@@[Flags]: 3
-COFF-I386: __TI2CVPAW4E@@[Flags.Const]: true
-COFF-I386: __TI2CVPAW4E@@[Flags.Volatile]: true
-COFF-I386: __TI2CVPAW4E@@[CleanupFn]: null
-COFF-I386: __TI2CVPAW4E@@[ForwardCompat]: null
-COFF-I386: __TI2CVPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
-COFF-I386: __TI2PAW4E@@[Flags]: 0
-COFF-I386: __TI2PAW4E@@[Flags.Const]: false
-COFF-I386: __TI2PAW4E@@[Flags.Volatile]: false
-COFF-I386: __TI2PAW4E@@[CleanupFn]: null
-COFF-I386: __TI2PAW4E@@[ForwardCompat]: null
-COFF-I386: __TI2PAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
-COFF-I386: __TI2PAX[Flags]: 0
-COFF-I386: __TI2PAX[Flags.Const]: false
-COFF-I386: __TI2PAX[Flags.Volatile]: false
-COFF-I386: __TI2PAX[CleanupFn]: null
-COFF-I386: __TI2PAX[ForwardCompat]: null
-COFF-I386: __TI2PAX[CatchableTypeArray]: __CTA2PAX
-COFF-I386: __TI2VPAW4E@@[Flags]: 2
-COFF-I386: __TI2VPAW4E@@[Flags.Const]: false
-COFF-I386: __TI2VPAW4E@@[Flags.Volatile]: true
-COFF-I386: __TI2VPAW4E@@[CleanupFn]: null
-COFF-I386: __TI2VPAW4E@@[ForwardCompat]: null
-COFF-I386: __TI2VPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
-COFF-I386: __TI3?AUM@@[Flags]: 0
-COFF-I386: __TI3?AUM@@[Flags.Const]: false
-COFF-I386: __TI3?AUM@@[Flags.Volatile]: false
-COFF-I386: __TI3?AUM@@[CleanupFn]: null
-COFF-I386: __TI3?AUM@@[ForwardCompat]: null
-COFF-I386: __TI3?AUM@@[CatchableTypeArray]: __CTA3?AUM@@
-COFF-I386: __TI3?AUS@@[Flags]: 0
-COFF-I386: __TI3?AUS@@[Flags.Const]: false
-COFF-I386: __TI3?AUS@@[Flags.Volatile]: false
-COFF-I386: __TI3?AUS@@[CleanupFn]: ??1S@@UAE at XZ
-COFF-I386: __TI3?AUS@@[ForwardCompat]: null
-COFF-I386: __TI3?AUS@@[CatchableTypeArray]: __CTA3?AUS@@
-COFF-I386: __TI4CPAUS@@[Flags]: 1
-COFF-I386: __TI4CPAUS@@[Flags.Const]: true
-COFF-I386: __TI4CPAUS@@[Flags.Volatile]: false
-COFF-I386: __TI4CPAUS@@[CleanupFn]: null
-COFF-I386: __TI4CPAUS@@[ForwardCompat]: null
-COFF-I386: __TI4CPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
-COFF-I386: __TI4CVPAUS@@[Flags]: 3
-COFF-I386: __TI4CVPAUS@@[Flags.Const]: true
-COFF-I386: __TI4CVPAUS@@[Flags.Volatile]: true
-COFF-I386: __TI4CVPAUS@@[CleanupFn]: null
-COFF-I386: __TI4CVPAUS@@[ForwardCompat]: null
-COFF-I386: __TI4CVPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
-COFF-I386: __TI4PAUS@@[Flags]: 0
-COFF-I386: __TI4PAUS@@[Flags.Const]: false
-COFF-I386: __TI4PAUS@@[Flags.Volatile]: false
-COFF-I386: __TI4PAUS@@[CleanupFn]: null
-COFF-I386: __TI4PAUS@@[ForwardCompat]: null
-COFF-I386: __TI4PAUS@@[CatchableTypeArray]: __CTA4PAUS@@
-COFF-I386: __TI4VPAUS@@[Flags]: 2
-COFF-I386: __TI4VPAUS@@[Flags.Const]: false
-COFF-I386: __TI4VPAUS@@[Flags.Volatile]: true
-COFF-I386: __TI4VPAUS@@[CleanupFn]: null
-COFF-I386: __TI4VPAUS@@[ForwardCompat]: null
-COFF-I386: __TI4VPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
-COFF-I386: __CTA1?AW4E@@[NumEntries]: 1
-COFF-I386: __CTA1?AW4E@@[0]: __CT??_R0?AW4E@@@84
-COFF-I386: __CTA1PQS@@H[NumEntries]: 1
-COFF-I386: __CTA1PQS@@H[0]: __CT??_R0PQS@@H at 88
-COFF-I386: __CTA2PAW4E@@[NumEntries]: 2
-COFF-I386: __CTA2PAW4E@@[0]: __CT??_R0PAW4E@@@84
-COFF-I386: __CTA2PAW4E@@[1]: __CT??_R0PAX at 84
-COFF-I386: __CTA2PAX[NumEntries]: 2
-COFF-I386: __CTA2PAX[0]: __CT??_R0PAX at 84
-COFF-I386: __CTA2PAX[1]: __CT??_R0PAX at 84
-COFF-I386: __CTA3?AUM@@[NumEntries]: 3
-COFF-I386: __CTA3?AUM@@[0]: __CT??_R0?AUM@@@88
-COFF-I386: __CTA3?AUM@@[1]: __CT??_R0?AUA@@@84
-COFF-I386: __CTA3?AUM@@[2]: __CT??_R0?AUB@@@844
-COFF-I386: __CTA3?AUS@@[NumEntries]: 3
-COFF-I386: __CTA3?AUS@@[0]: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16
-COFF-I386: __CTA3?AUS@@[1]: __CT??_R0?AUA@@@84044
-COFF-I386: __CTA3?AUS@@[2]: __CT??_R0?AUC@@@84048
-COFF-I386: __CTA4PAUS@@[NumEntries]: 4
-COFF-I386: __CTA4PAUS@@[0]: __CT??_R0PAUS@@@84
-COFF-I386: __CTA4PAUS@@[1]: __CT??_R0PAUA@@@84044
-COFF-I386: __CTA4PAUS@@[2]: __CT??_R0PAUC@@@84048
-COFF-I386: __CTA4PAUS@@[3]: __CT??_R0PAX at 84
-COFF-I386: __CT??_R0?AUA@@@84[Flags]: 0
-COFF-I386: __CT??_R0?AUA@@@84[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUA@@@84[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AUA@@@84[TypeDescriptor]: ??_R0?AUA@@@8
-COFF-I386: __CT??_R0?AUA@@@84[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUA@@@84[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0?AUA@@@84[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUA@@@84[Size]: 4
-COFF-I386: __CT??_R0?AUA@@@84[CopyCtor]: null
-COFF-I386: __CT??_R0?AUA@@@84044[Flags]: 0
-COFF-I386: __CT??_R0?AUA@@@84044[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUA@@@84044[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AUA@@@84044[TypeDescriptor]: ??_R0?AUA@@@8
-COFF-I386: __CT??_R0?AUA@@@84044[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUA@@@84044[VirtualBasePointerOffset]: 4
-COFF-I386: __CT??_R0?AUA@@@84044[VirtualBaseAdjustmentOffset]: 4
-COFF-I386: __CT??_R0?AUA@@@84044[Size]: 4
-COFF-I386: __CT??_R0?AUA@@@84044[CopyCtor]: null
-COFF-I386: __CT??_R0?AUB@@@844[Flags]: 0
-COFF-I386: __CT??_R0?AUB@@@844[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUB@@@844[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AUB@@@844[TypeDescriptor]: ??_R0?AUB@@@8
-COFF-I386: __CT??_R0?AUB@@@844[NonVirtualBaseAdjustmentOffset]: 4
-COFF-I386: __CT??_R0?AUB@@@844[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0?AUB@@@844[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUB@@@844[Size]: 4
-COFF-I386: __CT??_R0?AUB@@@844[CopyCtor]: null
-COFF-I386: __CT??_R0?AUC@@@84048[Flags]: 0
-COFF-I386: __CT??_R0?AUC@@@84048[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUC@@@84048[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AUC@@@84048[TypeDescriptor]: ??_R0?AUC@@@8
-COFF-I386: __CT??_R0?AUC@@@84048[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUC@@@84048[VirtualBasePointerOffset]: 4
-COFF-I386: __CT??_R0?AUC@@@84048[VirtualBaseAdjustmentOffset]: 8
-COFF-I386: __CT??_R0?AUC@@@84048[Size]: 4
-COFF-I386: __CT??_R0?AUC@@@84048[CopyCtor]: null
-COFF-I386: __CT??_R0?AUM@@@88[Flags]: 0
-COFF-I386: __CT??_R0?AUM@@@88[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUM@@@88[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AUM@@@88[TypeDescriptor]: ??_R0?AUM@@@8
-COFF-I386: __CT??_R0?AUM@@@88[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUM@@@88[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0?AUM@@@88[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUM@@@88[Size]: 8
-COFF-I386: __CT??_R0?AUM@@@88[CopyCtor]: null
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[Flags]: 4
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[Flags.ScalarType]: false
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[Flags.VirtualInheritance]: true
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[TypeDescriptor]: ??_R0?AUS@@@8
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[Size]: 16
-COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE at ABU0@@Z16[CopyCtor]: ??0S@@QAE at ABU0@@Z
-COFF-I386: __CT??_R0?AW4E@@@84[Flags]: 1
-COFF-I386: __CT??_R0?AW4E@@@84[Flags.ScalarType]: true
-COFF-I386: __CT??_R0?AW4E@@@84[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0?AW4E@@@84[TypeDescriptor]: ??_R0?AW4E@@@8
-COFF-I386: __CT??_R0?AW4E@@@84[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AW4E@@@84[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0?AW4E@@@84[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0?AW4E@@@84[Size]: 4
-COFF-I386: __CT??_R0?AW4E@@@84[CopyCtor]: null
-COFF-I386: __CT??_R0PAUA@@@84044[Flags]: 1
-COFF-I386: __CT??_R0PAUA@@@84044[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PAUA@@@84044[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0PAUA@@@84044[TypeDescriptor]: ??_R0PAUA@@@8
-COFF-I386: __CT??_R0PAUA@@@84044[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAUA@@@84044[VirtualBasePointerOffset]: 4
-COFF-I386: __CT??_R0PAUA@@@84044[VirtualBaseAdjustmentOffset]: 4
-COFF-I386: __CT??_R0PAUA@@@84044[Size]: 4
-COFF-I386: __CT??_R0PAUA@@@84044[CopyCtor]: null
-COFF-I386: __CT??_R0PAUC@@@84048[Flags]: 1
-COFF-I386: __CT??_R0PAUC@@@84048[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PAUC@@@84048[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0PAUC@@@84048[TypeDescriptor]: ??_R0PAUC@@@8
-COFF-I386: __CT??_R0PAUC@@@84048[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAUC@@@84048[VirtualBasePointerOffset]: 4
-COFF-I386: __CT??_R0PAUC@@@84048[VirtualBaseAdjustmentOffset]: 8
-COFF-I386: __CT??_R0PAUC@@@84048[Size]: 4
-COFF-I386: __CT??_R0PAUC@@@84048[CopyCtor]: null
-COFF-I386: __CT??_R0PAUS@@@84[Flags]: 5
-COFF-I386: __CT??_R0PAUS@@@84[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PAUS@@@84[Flags.VirtualInheritance]: true
-COFF-I386: __CT??_R0PAUS@@@84[TypeDescriptor]: ??_R0PAUS@@@8
-COFF-I386: __CT??_R0PAUS@@@84[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAUS@@@84[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0PAUS@@@84[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAUS@@@84[Size]: 4
-COFF-I386: __CT??_R0PAUS@@@84[CopyCtor]: null
-COFF-I386: __CT??_R0PAW4E@@@84[Flags]: 1
-COFF-I386: __CT??_R0PAW4E@@@84[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PAW4E@@@84[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0PAW4E@@@84[TypeDescriptor]: ??_R0PAW4E@@@8
-COFF-I386: __CT??_R0PAW4E@@@84[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAW4E@@@84[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0PAW4E@@@84[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAW4E@@@84[Size]: 4
-COFF-I386: __CT??_R0PAW4E@@@84[CopyCtor]: null
-COFF-I386: __CT??_R0PAX at 84[Flags]: 1
-COFF-I386: __CT??_R0PAX at 84[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PAX at 84[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0PAX at 84[TypeDescriptor]: ??_R0PAX at 8
-COFF-I386: __CT??_R0PAX at 84[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAX at 84[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0PAX at 84[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PAX at 84[Size]: 4
-COFF-I386: __CT??_R0PAX at 84[CopyCtor]: null
-COFF-I386: __CT??_R0PQS@@H at 88[Flags]: 1
-COFF-I386: __CT??_R0PQS@@H at 88[Flags.ScalarType]: true
-COFF-I386: __CT??_R0PQS@@H at 88[Flags.VirtualInheritance]: false
-COFF-I386: __CT??_R0PQS@@H at 88[TypeDescriptor]: ??_R0PQS@@H at 8
-COFF-I386: __CT??_R0PQS@@H at 88[NonVirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PQS@@H at 88[VirtualBasePointerOffset]: -1
-COFF-I386: __CT??_R0PQS@@H at 88[VirtualBaseAdjustmentOffset]: 0
-COFF-I386: __CT??_R0PQS@@H at 88[Size]: 8
-COFF-I386: __CT??_R0PQS@@H at 88[CopyCtor]: null
Removed: llvm/trunk/test/tools/llvm-vtabledump/trivial.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/trivial.test?rev=232300&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-vtabledump/trivial.test (original)
+++ llvm/trunk/test/tools/llvm-vtabledump/trivial.test (removed)
@@ -1,58 +0,0 @@
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.coff-i386 \
-RUN: | FileCheck %s --check-prefix=COFF-I386
-
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.elf-i386 \
-RUN: | FileCheck %s --check-prefix=ELF-I386
-
-COFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
-COFF-I386-NEXT: ??_7S@@6B@[4]: ??_GS@@UAEPAXI at Z
-COFF-I386-NEXT: ??_8S@@7B@[0]: -4
-COFF-I386-NEXT: ??_8S@@7B@[4]: 4
-COFF-I386-NEXT: ??_R4S@@6B@[IsImageRelative]: 0
-COFF-I386-NEXT: ??_R4S@@6B@[OffsetToTop]: 0
-COFF-I386-NEXT: ??_R4S@@6B@[VFPtrOffset]: 0
-COFF-I386-NEXT: ??_R4S@@6B@[TypeDescriptor]: ??_R0?AUS@@@8
-COFF-I386-NEXT: ??_R4S@@6B@[ClassHierarchyDescriptor]: ??_R3S@@8
-COFF-I386-NEXT: ??_R3A@@8[AlwaysZero]: 0
-COFF-I386-NEXT: ??_R3A@@8[Flags]: 0
-COFF-I386-NEXT: ??_R3A@@8[NumClasses]: 1
-COFF-I386-NEXT: ??_R3A@@8[BaseClassArray]: ??_R2A@@8
-COFF-I386-NEXT: ??_R3S@@8[AlwaysZero]: 0
-COFF-I386-NEXT: ??_R3S@@8[Flags]: 0
-COFF-I386-NEXT: ??_R3S@@8[NumClasses]: 2
-COFF-I386-NEXT: ??_R3S@@8[BaseClassArray]: ??_R2S@@8
-COFF-I386-NEXT: ??_R2A@@8[0]: ??_R1A@?0A at EA@A@@8
-COFF-I386-NEXT: ??_R2S@@8[0]: ??_R1A@?0A at EA@S@@8
-COFF-I386-NEXT: ??_R2S@@8[4]: ??_R1A at 33FA@A@@8
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[TypeDescriptor]: ??_R0?AUA@@@8
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[NumBases]: 0
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[OffsetInVBase]: 0
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[VBPtrOffset]: 4
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[OffsetInVBTable]: 4
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[Flags]: 80
-COFF-I386-NEXT: ??_R1A at 33FA@A@@8[ClassHierarchyDescriptor]: ??_R3A@@8
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[TypeDescriptor]: ??_R0?AUA@@@8
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[NumBases]: 0
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[OffsetInVBase]: 0
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[VBPtrOffset]: -1
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[OffsetInVBTable]: 0
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[Flags]: 64
-COFF-I386-NEXT: ??_R1A@?0A at EA@A@@8[ClassHierarchyDescriptor]: ??_R3A@@8
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[TypeDescriptor]: ??_R0?AUS@@@8
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[NumBases]: 1
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[OffsetInVBase]: 0
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[VBPtrOffset]: -1
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[OffsetInVBTable]: 0
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[Flags]: 64
-COFF-I386-NEXT: ??_R1A@?0A at EA@S@@8[ClassHierarchyDescriptor]: ??_R3S@@8
-COFF-I386-NEXT: ??_R0?AUA@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386-NEXT: ??_R0?AUA@@@8[AlwaysZero]: 0
-COFF-I386-NEXT: ??_R0?AUA@@@8[MangledName]: .?AUA@@
-COFF-I386-NEXT: ??_R0?AUS@@@8[VFPtr]: ??_7type_info@@6B@
-COFF-I386-NEXT: ??_R0?AUS@@@8[AlwaysZero]: 0
-COFF-I386-NEXT: ??_R0?AUS@@@8[MangledName]: .?AUS@@
-
-ELF-I386: _ZTS1A: 1A
-ELF-I386-NEXT: _ZTV1A[0]: 0
-ELF-I386-NEXT: _ZTV1A[4]: _ZTI1A
-ELF-I386-NEXT: _ZTV1A[8]: _ZN1A1fEv
Modified: llvm/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/CMakeLists.txt?rev=232301&r1=232300&r2=232301&view=diff
==============================================================================
--- llvm/trunk/tools/CMakeLists.txt (original)
+++ llvm/trunk/tools/CMakeLists.txt Sat Mar 14 20:30:58 2015
@@ -37,7 +37,7 @@ add_llvm_tool_subdirectory(llvm-readobj)
add_llvm_tool_subdirectory(llvm-rtdyld)
add_llvm_tool_subdirectory(llvm-dwarfdump)
add_llvm_tool_subdirectory(dsymutil)
-add_llvm_tool_subdirectory(llvm-vtabledump)
+add_llvm_tool_subdirectory(llvm-cxxdump)
if( LLVM_USE_INTEL_JITEVENTS )
add_llvm_tool_subdirectory(llvm-jitlistener)
else()
Modified: llvm/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/Makefile?rev=232301&r1=232300&r2=232301&view=diff
==============================================================================
--- llvm/trunk/tools/Makefile (original)
+++ llvm/trunk/tools/Makefile Sat Mar 14 20:30:58 2015
@@ -33,7 +33,7 @@ PARALLEL_DIRS := opt llvm-as llvm-dis ll
macho-dump llvm-objdump llvm-readobj llvm-rtdyld \
llvm-dwarfdump llvm-cov llvm-size llvm-stress llvm-mcmarkup \
llvm-profdata llvm-symbolizer obj2yaml yaml2obj llvm-c-test \
- llvm-vtabledump verify-uselistorder dsymutil llvm-pdbdump
+ llvm-cxxdump verify-uselistorder dsymutil llvm-pdbdump
# If Intel JIT Events support is configured, build an extra tool to test it.
ifeq ($(USE_INTEL_JITEVENTS), 1)
Copied: llvm/trunk/tools/llvm-cxxdump/CMakeLists.txt (from r232300, llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/CMakeLists.txt?p2=llvm/trunk/tools/llvm-cxxdump/CMakeLists.txt&p1=llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-cxxdump/CMakeLists.txt Sat Mar 14 20:30:58 2015
@@ -4,7 +4,7 @@ set(LLVM_LINK_COMPONENTS
Support
)
-add_llvm_tool(llvm-vtabledump
- llvm-vtabledump.cpp
+add_llvm_tool(llvm-cxxdump
+ llvm-cxxdump.cpp
Error.cpp
)
Copied: llvm/trunk/tools/llvm-cxxdump/Error.cpp (from r232300, llvm/trunk/tools/llvm-vtabledump/Error.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/Error.cpp?p2=llvm/trunk/tools/llvm-cxxdump/Error.cpp&p1=llvm/trunk/tools/llvm-vtabledump/Error.cpp&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Error.cpp (original)
+++ llvm/trunk/tools/llvm-cxxdump/Error.cpp Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-//===- Error.cpp - system_error extensions for llvm-vtabledump --*- C++ -*-===//
+//===- Error.cxx - system_error extensions for llvm-cxxdump -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This defines a new error_category for the llvm-vtabledump tool.
+// This defines a new error_category for the llvm-cxxdump tool.
//
//===----------------------------------------------------------------------===//
@@ -17,27 +17,27 @@
using namespace llvm;
namespace {
-class vtabledump_error_category : public std::error_category {
+class cxxdump_error_category : public std::error_category {
public:
- const char *name() const LLVM_NOEXCEPT override { return "llvm.vtabledump"; }
+ const char *name() const LLVM_NOEXCEPT override { return "llvm.cxxdump"; }
std::string message(int ev) const override {
- switch (static_cast<vtabledump_error>(ev)) {
- case vtabledump_error::success:
+ switch (static_cast<cxxdump_error>(ev)) {
+ case cxxdump_error::success:
return "Success";
- case vtabledump_error::file_not_found:
+ case cxxdump_error::file_not_found:
return "No such file.";
- case vtabledump_error::unrecognized_file_format:
+ case cxxdump_error::unrecognized_file_format:
return "Unrecognized file type.";
}
llvm_unreachable(
- "An enumerator of vtabledump_error does not have a message defined.");
+ "An enumerator of cxxdump_error does not have a message defined.");
}
};
} // namespace
namespace llvm {
-const std::error_category &vtabledump_category() {
- static vtabledump_error_category o;
+const std::error_category &cxxdump_category() {
+ static cxxdump_error_category o;
return o;
}
} // namespace llvm
Copied: llvm/trunk/tools/llvm-cxxdump/Error.h (from r232300, llvm/trunk/tools/llvm-vtabledump/Error.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/Error.h?p2=llvm/trunk/tools/llvm-cxxdump/Error.h&p1=llvm/trunk/tools/llvm-vtabledump/Error.h&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Error.h (original)
+++ llvm/trunk/tools/llvm-cxxdump/Error.h Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-//===- Error.h - system_error extensions for llvm-vtabledump ----*- C++ -*-===//
+//===- Error.h - system_error extensions for llvm-cxxdump -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,33 +7,33 @@
//
//===----------------------------------------------------------------------===//
//
-// This declares a new error_category for the llvm-vtabledump tool.
+// This declares a new error_category for the llvm-cxxdump tool.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
+#ifndef LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
+#define LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
#include <system_error>
namespace llvm {
-const std::error_category &vtabledump_category();
+const std::error_category &cxxdump_category();
-enum class vtabledump_error {
+enum class cxxdump_error {
success = 0,
file_not_found,
unrecognized_file_format,
};
-inline std::error_code make_error_code(vtabledump_error e) {
- return std::error_code(static_cast<int>(e), vtabledump_category());
+inline std::error_code make_error_code(cxxdump_error e) {
+ return std::error_code(static_cast<int>(e), cxxdump_category());
}
} // namespace llvm
namespace std {
template <>
-struct is_error_code_enum<llvm::vtabledump_error> : std::true_type {};
+struct is_error_code_enum<llvm::cxxdump_error> : std::true_type {};
}
#endif
Copied: llvm/trunk/tools/llvm-cxxdump/LLVMBuild.txt (from r232300, llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/LLVMBuild.txt?p2=llvm/trunk/tools/llvm-cxxdump/LLVMBuild.txt&p1=llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt (original)
+++ llvm/trunk/tools/llvm-cxxdump/LLVMBuild.txt Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-;===- ./tools/llvm-vtabledump/LLVMBuild.txt --------------------*- Conf -*--===;
+;===- ./tools/llvm-cxxdump/LLVMBuild.txt -----------------------*- Conf -*--===;
;
; The LLVM Compiler Infrastructure
;
@@ -17,6 +17,6 @@
[component_0]
type = Tool
-name = llvm-vtabledump
+name = llvm-cxxdump
parent = Tools
required_libraries = all-targets BitReader Object
Copied: llvm/trunk/tools/llvm-cxxdump/Makefile (from r232300, llvm/trunk/tools/llvm-vtabledump/Makefile)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/Makefile?p2=llvm/trunk/tools/llvm-cxxdump/Makefile&p1=llvm/trunk/tools/llvm-vtabledump/Makefile&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Makefile (original)
+++ llvm/trunk/tools/llvm-cxxdump/Makefile Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-##===- tools/llvm-vtabledump/Makefile ----------------------*- Makefile -*-===##
+##===- tools/llvm-cxxdump/Makefile -------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
@@ -8,7 +8,7 @@
##===----------------------------------------------------------------------===##
LEVEL := ../..
-TOOLNAME := llvm-vtabledump
+TOOLNAME := llvm-cxxdump
LINK_COMPONENTS := bitreader object all-targets
# This tool has no plugins, optimize startup time.
Copied: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp (from r232300, llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?p2=llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp&p1=llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp (original)
+++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-//===- llvm-vtabledump.cpp - Dump vtables in an Object File -----*- C++ -*-===//
+//===- llvm-cxxdump.cpp - Dump C++ data in an Object File -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
//
-// Dumps VTables resident in object files and archives.
+// Dumps C++ data resident in object files and archives.
//
//===----------------------------------------------------------------------===//
-#include "llvm-vtabledump.h"
+#include "llvm-cxxdump.h"
#include "Error.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Object/Archive.h"
@@ -134,7 +134,7 @@ static bool collectRelocationOffsets(
return false;
}
-static void dumpVTables(const ObjectFile *Obj) {
+static void dumpCXXData(const ObjectFile *Obj) {
struct CompleteObjectLocator {
StringRef Symbols[2];
ArrayRef<little32_t> Data;
@@ -333,7 +333,8 @@ static void dumpVTables(const ObjectFile
auto Key = std::make_pair(SymName, SymOffI);
if (VTableSymEntries.count(Key))
continue;
- const char *DataPtr = SymContents.substr(SymOffI, BytesInAddress).data();
+ const char *DataPtr =
+ SymContents.substr(SymOffI, BytesInAddress).data();
int64_t VData;
if (BytesInAddress == 8)
VData = *reinterpret_cast<const little64_t *>(DataPtr);
@@ -347,8 +348,7 @@ static void dumpVTables(const ObjectFile
// FIXME: Do something with these!
}
}
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VFTableEntry :
- VFTableEntries) {
+ for (const auto &VFTableEntry : VFTableEntries) {
StringRef VFTableName = VFTableEntry.first.first;
uint64_t Offset = VFTableEntry.first.second;
StringRef SymName = VFTableEntry.second;
@@ -369,7 +369,8 @@ static void dumpVTables(const ObjectFile
outs() << COLName << "[OffsetToTop]: " << COL.Data[1] << '\n';
outs() << COLName << "[VFPtrOffset]: " << COL.Data[2] << '\n';
outs() << COLName << "[TypeDescriptor]: " << COL.Symbols[0] << '\n';
- outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1] << '\n';
+ outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1]
+ << '\n';
}
for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair : CHDs) {
StringRef CHDName = CHDPair.first;
@@ -395,7 +396,8 @@ static void dumpVTables(const ObjectFile
outs() << BCDName << "[VBPtrOffset]: " << BCD.Data[2] << '\n';
outs() << BCDName << "[OffsetInVBTable]: " << BCD.Data[3] << '\n';
outs() << BCDName << "[Flags]: " << BCD.Data[4] << '\n';
- outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1] << '\n';
+ outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1]
+ << '\n';
}
for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) {
StringRef TDName = TDPair.first;
@@ -515,17 +517,16 @@ static void dumpArchive(const Archive *A
}
if (ObjectFile *Obj = dyn_cast<ObjectFile>(&*ChildOrErr.get()))
- dumpVTables(Obj);
+ dumpCXXData(Obj);
else
- reportError(Arc->getFileName(),
- vtabledump_error::unrecognized_file_format);
+ reportError(Arc->getFileName(), cxxdump_error::unrecognized_file_format);
}
}
static void dumpInput(StringRef File) {
// If file isn't stdin, check that it exists.
if (File != "-" && !sys::fs::exists(File)) {
- reportError(File, vtabledump_error::file_not_found);
+ reportError(File, cxxdump_error::file_not_found);
return;
}
@@ -540,9 +541,9 @@ static void dumpInput(StringRef File) {
if (Archive *Arc = dyn_cast<Archive>(&Binary))
dumpArchive(Arc);
else if (ObjectFile *Obj = dyn_cast<ObjectFile>(&Binary))
- dumpVTables(Obj);
+ dumpCXXData(Obj);
else
- reportError(File, vtabledump_error::unrecognized_file_format);
+ reportError(File, cxxdump_error::unrecognized_file_format);
}
int main(int argc, const char *argv[]) {
@@ -556,7 +557,7 @@ int main(int argc, const char *argv[]) {
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
- cl::ParseCommandLineOptions(argc, argv, "LLVM VTable Dumper\n");
+ cl::ParseCommandLineOptions(argc, argv, "LLVM C++ ABI Data Dumper\n");
// Default to stdin if no filename is specified.
if (opts::InputFilenames.size() == 0)
Copied: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.h (from r232300, llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.h?p2=llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.h&p1=llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h&r1=232300&r2=232301&rev=232301&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h (original)
+++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.h Sat Mar 14 20:30:58 2015
@@ -1,4 +1,4 @@
-//===-- llvm-vtabledump.h ---------------------------------------*- C++ -*-===//
+//===-- llvm-cxxdump.h ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
+#ifndef LLVM_TOOLS_LLVM_CXXDUMP_LLVM_CXXDUMP_H
+#define LLVM_TOOLS_LLVM_CXXDUMP_LLVM_CXXDUMP_H
#include "llvm/Support/CommandLine.h"
#include <string>
@@ -17,7 +17,7 @@ namespace opts {
extern llvm::cl::list<std::string> InputFilenames;
} // namespace opts
-#define LLVM_VTABLEDUMP_ENUM_ENT(ns, enum) \
+#define LLVM_CXXDUMP_ENUM_ENT(ns, enum) \
{ #enum, ns::enum }
#endif
Removed: llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-vtabledump/CMakeLists.txt (removed)
@@ -1,10 +0,0 @@
-set(LLVM_LINK_COMPONENTS
- ${LLVM_TARGETS_TO_BUILD}
- Object
- Support
- )
-
-add_llvm_tool(llvm-vtabledump
- llvm-vtabledump.cpp
- Error.cpp
- )
Removed: llvm/trunk/tools/llvm-vtabledump/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/Error.cpp?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Error.cpp (original)
+++ llvm/trunk/tools/llvm-vtabledump/Error.cpp (removed)
@@ -1,43 +0,0 @@
-//===- Error.cpp - system_error extensions for llvm-vtabledump --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This defines a new error_category for the llvm-vtabledump tool.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Error.h"
-#include "llvm/Support/ErrorHandling.h"
-
-using namespace llvm;
-
-namespace {
-class vtabledump_error_category : public std::error_category {
-public:
- const char *name() const LLVM_NOEXCEPT override { return "llvm.vtabledump"; }
- std::string message(int ev) const override {
- switch (static_cast<vtabledump_error>(ev)) {
- case vtabledump_error::success:
- return "Success";
- case vtabledump_error::file_not_found:
- return "No such file.";
- case vtabledump_error::unrecognized_file_format:
- return "Unrecognized file type.";
- }
- llvm_unreachable(
- "An enumerator of vtabledump_error does not have a message defined.");
- }
-};
-} // namespace
-
-namespace llvm {
-const std::error_category &vtabledump_category() {
- static vtabledump_error_category o;
- return o;
-}
-} // namespace llvm
Removed: llvm/trunk/tools/llvm-vtabledump/Error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/Error.h?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Error.h (original)
+++ llvm/trunk/tools/llvm-vtabledump/Error.h (removed)
@@ -1,39 +0,0 @@
-//===- Error.h - system_error extensions for llvm-vtabledump ----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This declares a new error_category for the llvm-vtabledump tool.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
-
-#include <system_error>
-
-namespace llvm {
-const std::error_category &vtabledump_category();
-
-enum class vtabledump_error {
- success = 0,
- file_not_found,
- unrecognized_file_format,
-};
-
-inline std::error_code make_error_code(vtabledump_error e) {
- return std::error_code(static_cast<int>(e), vtabledump_category());
-}
-
-} // namespace llvm
-
-namespace std {
-template <>
-struct is_error_code_enum<llvm::vtabledump_error> : std::true_type {};
-}
-
-#endif
Removed: llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt (original)
+++ llvm/trunk/tools/llvm-vtabledump/LLVMBuild.txt (removed)
@@ -1,22 +0,0 @@
-;===- ./tools/llvm-vtabledump/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; The LLVM Compiler Infrastructure
-;
-; This file is distributed under the University of Illinois Open Source
-; License. See LICENSE.TXT for details.
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-; http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-vtabledump
-parent = Tools
-required_libraries = all-targets BitReader Object
Removed: llvm/trunk/tools/llvm-vtabledump/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/Makefile?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/Makefile (original)
+++ llvm/trunk/tools/llvm-vtabledump/Makefile (removed)
@@ -1,18 +0,0 @@
-##===- tools/llvm-vtabledump/Makefile ----------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../..
-TOOLNAME := llvm-vtabledump
-LINK_COMPONENTS := bitreader object all-targets
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS := 1
-
-include $(LEVEL)/Makefile.common
-
Removed: llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp (original)
+++ llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp (removed)
@@ -1,569 +0,0 @@
-//===- llvm-vtabledump.cpp - Dump vtables in an Object File -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Dumps VTables resident in object files and archives.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-vtabledump.h"
-#include "Error.h"
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/Object/Archive.h"
-#include "llvm/Object/ObjectFile.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/Endian.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/Signals.h"
-#include "llvm/Support/TargetRegistry.h"
-#include "llvm/Support/TargetSelect.h"
-#include <map>
-#include <string>
-#include <system_error>
-
-using namespace llvm;
-using namespace llvm::object;
-using namespace llvm::support;
-
-namespace opts {
-cl::list<std::string> InputFilenames(cl::Positional,
- cl::desc("<input object files>"),
- cl::ZeroOrMore);
-} // namespace opts
-
-static int ReturnValue = EXIT_SUCCESS;
-
-namespace llvm {
-
-static bool error(std::error_code EC) {
- if (!EC)
- return false;
-
- ReturnValue = EXIT_FAILURE;
- outs() << "\nError reading file: " << EC.message() << ".\n";
- outs().flush();
- return true;
-}
-
-} // namespace llvm
-
-static void reportError(StringRef Input, StringRef Message) {
- if (Input == "-")
- Input = "<stdin>";
-
- errs() << Input << ": " << Message << "\n";
- errs().flush();
- ReturnValue = EXIT_FAILURE;
-}
-
-static void reportError(StringRef Input, std::error_code EC) {
- reportError(Input, EC.message());
-}
-
-static SmallVectorImpl<SectionRef> &getRelocSections(const ObjectFile *Obj,
- const SectionRef &Sec) {
- static bool MappingDone = false;
- static std::map<SectionRef, SmallVector<SectionRef, 1>> SectionRelocMap;
- if (!MappingDone) {
- for (const SectionRef &Section : Obj->sections()) {
- section_iterator Sec2 = Section.getRelocatedSection();
- if (Sec2 != Obj->section_end())
- SectionRelocMap[*Sec2].push_back(Section);
- }
- MappingDone = true;
- }
- return SectionRelocMap[Sec];
-}
-
-static bool collectRelocatedSymbols(const ObjectFile *Obj,
- const SectionRef &Sec, uint64_t SecAddress,
- uint64_t SymAddress, uint64_t SymSize,
- StringRef *I, StringRef *E) {
- uint64_t SymOffset = SymAddress - SecAddress;
- uint64_t SymEnd = SymOffset + SymSize;
- for (const SectionRef &SR : getRelocSections(Obj, Sec)) {
- for (const object::RelocationRef &Reloc : SR.relocations()) {
- if (I == E)
- break;
- const object::symbol_iterator RelocSymI = Reloc.getSymbol();
- if (RelocSymI == Obj->symbol_end())
- continue;
- StringRef RelocSymName;
- if (error(RelocSymI->getName(RelocSymName)))
- return true;
- uint64_t Offset;
- if (error(Reloc.getOffset(Offset)))
- return true;
- if (Offset >= SymOffset && Offset < SymEnd) {
- *I = RelocSymName;
- ++I;
- }
- }
- }
- return false;
-}
-
-static bool collectRelocationOffsets(
- const ObjectFile *Obj, const SectionRef &Sec, uint64_t SecAddress,
- uint64_t SymAddress, uint64_t SymSize, StringRef SymName,
- std::map<std::pair<StringRef, uint64_t>, StringRef> &Collection) {
- uint64_t SymOffset = SymAddress - SecAddress;
- uint64_t SymEnd = SymOffset + SymSize;
- for (const SectionRef &SR : getRelocSections(Obj, Sec)) {
- for (const object::RelocationRef &Reloc : SR.relocations()) {
- const object::symbol_iterator RelocSymI = Reloc.getSymbol();
- if (RelocSymI == Obj->symbol_end())
- continue;
- StringRef RelocSymName;
- if (error(RelocSymI->getName(RelocSymName)))
- return true;
- uint64_t Offset;
- if (error(Reloc.getOffset(Offset)))
- return true;
- if (Offset >= SymOffset && Offset < SymEnd)
- Collection[std::make_pair(SymName, Offset - SymOffset)] = RelocSymName;
- }
- }
- return false;
-}
-
-static void dumpVTables(const ObjectFile *Obj) {
- struct CompleteObjectLocator {
- StringRef Symbols[2];
- ArrayRef<little32_t> Data;
- };
- struct ClassHierarchyDescriptor {
- StringRef Symbols[1];
- ArrayRef<little32_t> Data;
- };
- struct BaseClassDescriptor {
- StringRef Symbols[2];
- ArrayRef<little32_t> Data;
- };
- struct TypeDescriptor {
- StringRef Symbols[1];
- uint64_t AlwaysZero;
- StringRef MangledName;
- };
- struct ThrowInfo {
- uint32_t Flags;
- };
- struct CatchableTypeArray {
- uint32_t NumEntries;
- };
- struct CatchableType {
- uint32_t Flags;
- uint32_t NonVirtualBaseAdjustmentOffset;
- int32_t VirtualBasePointerOffset;
- uint32_t VirtualBaseAdjustmentOffset;
- uint32_t Size;
- StringRef Symbols[2];
- };
- std::map<std::pair<StringRef, uint64_t>, StringRef> VFTableEntries;
- std::map<std::pair<StringRef, uint64_t>, StringRef> TIEntries;
- std::map<std::pair<StringRef, uint64_t>, StringRef> CTAEntries;
- std::map<StringRef, ArrayRef<little32_t>> VBTables;
- std::map<StringRef, CompleteObjectLocator> COLs;
- std::map<StringRef, ClassHierarchyDescriptor> CHDs;
- std::map<std::pair<StringRef, uint64_t>, StringRef> BCAEntries;
- std::map<StringRef, BaseClassDescriptor> BCDs;
- std::map<StringRef, TypeDescriptor> TDs;
- std::map<StringRef, ThrowInfo> TIs;
- std::map<StringRef, CatchableTypeArray> CTAs;
- std::map<StringRef, CatchableType> CTs;
-
- std::map<std::pair<StringRef, uint64_t>, StringRef> VTableSymEntries;
- std::map<std::pair<StringRef, uint64_t>, int64_t> VTableDataEntries;
- std::map<std::pair<StringRef, uint64_t>, StringRef> VTTEntries;
- std::map<StringRef, StringRef> TINames;
-
- uint8_t BytesInAddress = Obj->getBytesInAddress();
-
- for (const object::SymbolRef &Sym : Obj->symbols()) {
- StringRef SymName;
- if (error(Sym.getName(SymName)))
- return;
- object::section_iterator SecI(Obj->section_begin());
- if (error(Sym.getSection(SecI)))
- return;
- // Skip external symbols.
- if (SecI == Obj->section_end())
- continue;
- const SectionRef &Sec = *SecI;
- // Skip virtual or BSS sections.
- if (Sec.isBSS() || Sec.isVirtual())
- continue;
- StringRef SecContents;
- if (error(Sec.getContents(SecContents)))
- return;
- uint64_t SymAddress, SymSize;
- if (error(Sym.getAddress(SymAddress)) || error(Sym.getSize(SymSize)))
- return;
- uint64_t SecAddress = Sec.getAddress();
- uint64_t SecSize = Sec.getSize();
- uint64_t SymOffset = SymAddress - SecAddress;
- StringRef SymContents = SecContents.substr(SymOffset, SymSize);
-
- // VFTables in the MS-ABI start with '??_7' and are contained within their
- // own COMDAT section. We then determine the contents of the VFTable by
- // looking at each relocation in the section.
- if (SymName.startswith("??_7")) {
- // Each relocation either names a virtual method or a thunk. We note the
- // offset into the section and the symbol used for the relocation.
- collectRelocationOffsets(Obj, Sec, SecAddress, SecAddress, SecSize,
- SymName, VFTableEntries);
- }
- // VBTables in the MS-ABI start with '??_8' and are filled with 32-bit
- // offsets of virtual bases.
- else if (SymName.startswith("??_8")) {
- ArrayRef<little32_t> VBTableData(
- reinterpret_cast<const little32_t *>(SymContents.data()),
- SymContents.size() / sizeof(little32_t));
- VBTables[SymName] = VBTableData;
- }
- // Complete object locators in the MS-ABI start with '??_R4'
- else if (SymName.startswith("??_R4")) {
- CompleteObjectLocator COL;
- COL.Data = ArrayRef<little32_t>(
- reinterpret_cast<const little32_t *>(SymContents.data()), 3);
- StringRef *I = std::begin(COL.Symbols), *E = std::end(COL.Symbols);
- if (collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I,
- E))
- return;
- COLs[SymName] = COL;
- }
- // Class hierarchy descriptors in the MS-ABI start with '??_R3'
- else if (SymName.startswith("??_R3")) {
- ClassHierarchyDescriptor CHD;
- CHD.Data = ArrayRef<little32_t>(
- reinterpret_cast<const little32_t *>(SymContents.data()), 3);
- StringRef *I = std::begin(CHD.Symbols), *E = std::end(CHD.Symbols);
- if (collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I,
- E))
- return;
- CHDs[SymName] = CHD;
- }
- // Class hierarchy descriptors in the MS-ABI start with '??_R2'
- else if (SymName.startswith("??_R2")) {
- // Each relocation names a base class descriptor. We note the offset into
- // the section and the symbol used for the relocation.
- collectRelocationOffsets(Obj, Sec, SecAddress, SymAddress, SymSize,
- SymName, BCAEntries);
- }
- // Base class descriptors in the MS-ABI start with '??_R1'
- else if (SymName.startswith("??_R1")) {
- BaseClassDescriptor BCD;
- BCD.Data = ArrayRef<little32_t>(
- reinterpret_cast<const little32_t *>(SymContents.data()) + 1, 5);
- StringRef *I = std::begin(BCD.Symbols), *E = std::end(BCD.Symbols);
- if (collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I,
- E))
- return;
- BCDs[SymName] = BCD;
- }
- // Type descriptors in the MS-ABI start with '??_R0'
- else if (SymName.startswith("??_R0")) {
- const char *DataPtr = SymContents.drop_front(BytesInAddress).data();
- TypeDescriptor TD;
- if (BytesInAddress == 8)
- TD.AlwaysZero = *reinterpret_cast<const little64_t *>(DataPtr);
- else
- TD.AlwaysZero = *reinterpret_cast<const little32_t *>(DataPtr);
- TD.MangledName = SymContents.drop_front(BytesInAddress * 2);
- StringRef *I = std::begin(TD.Symbols), *E = std::end(TD.Symbols);
- if (collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I,
- E))
- return;
- TDs[SymName] = TD;
- }
- // Throw descriptors in the MS-ABI start with '_TI'
- else if (SymName.startswith("_TI") || SymName.startswith("__TI")) {
- ThrowInfo TI;
- TI.Flags = *reinterpret_cast<const little32_t *>(SymContents.data());
- collectRelocationOffsets(Obj, Sec, SecAddress, SymAddress, SymSize,
- SymName, TIEntries);
- TIs[SymName] = TI;
- }
- // Catchable type arrays in the MS-ABI start with _CTA or __CTA.
- else if (SymName.startswith("_CTA") || SymName.startswith("__CTA")) {
- CatchableTypeArray CTA;
- CTA.NumEntries =
- *reinterpret_cast<const little32_t *>(SymContents.data());
- collectRelocationOffsets(Obj, Sec, SecAddress, SymAddress, SymSize,
- SymName, CTAEntries);
- CTAs[SymName] = CTA;
- }
- // Catchable types in the MS-ABI start with _CT or __CT.
- else if (SymName.startswith("_CT") || SymName.startswith("__CT")) {
- const little32_t *DataPtr =
- reinterpret_cast<const little32_t *>(SymContents.data());
- CatchableType CT;
- CT.Flags = DataPtr[0];
- CT.NonVirtualBaseAdjustmentOffset = DataPtr[2];
- CT.VirtualBasePointerOffset = DataPtr[3];
- CT.VirtualBaseAdjustmentOffset = DataPtr[4];
- CT.Size = DataPtr[5];
- StringRef *I = std::begin(CT.Symbols), *E = std::end(CT.Symbols);
- if (collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I,
- E))
- return;
- CTs[SymName] = CT;
- }
- // Construction vtables in the Itanium ABI start with '_ZTT' or '__ZTT'.
- else if (SymName.startswith("_ZTT") || SymName.startswith("__ZTT")) {
- collectRelocationOffsets(Obj, Sec, SecAddress, SymAddress, SymSize,
- SymName, VTTEntries);
- }
- // Typeinfo names in the Itanium ABI start with '_ZTS' or '__ZTS'.
- else if (SymName.startswith("_ZTS") || SymName.startswith("__ZTS")) {
- TINames[SymName] = SymContents.slice(0, SymContents.find('\0'));
- }
- // Vtables in the Itanium ABI start with '_ZTV' or '__ZTV'.
- else if (SymName.startswith("_ZTV") || SymName.startswith("__ZTV")) {
- collectRelocationOffsets(Obj, Sec, SecAddress, SymAddress, SymSize,
- SymName, VTableSymEntries);
- for (uint64_t SymOffI = 0; SymOffI < SymSize; SymOffI += BytesInAddress) {
- auto Key = std::make_pair(SymName, SymOffI);
- if (VTableSymEntries.count(Key))
- continue;
- const char *DataPtr = SymContents.substr(SymOffI, BytesInAddress).data();
- int64_t VData;
- if (BytesInAddress == 8)
- VData = *reinterpret_cast<const little64_t *>(DataPtr);
- else
- VData = *reinterpret_cast<const little32_t *>(DataPtr);
- VTableDataEntries[Key] = VData;
- }
- }
- // Typeinfo structures in the Itanium ABI start with '_ZTI' or '__ZTI'.
- else if (SymName.startswith("_ZTI") || SymName.startswith("__ZTI")) {
- // FIXME: Do something with these!
- }
- }
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VFTableEntry :
- VFTableEntries) {
- StringRef VFTableName = VFTableEntry.first.first;
- uint64_t Offset = VFTableEntry.first.second;
- StringRef SymName = VFTableEntry.second;
- outs() << VFTableName << '[' << Offset << "]: " << SymName << '\n';
- }
- for (const std::pair<StringRef, ArrayRef<little32_t>> &VBTable : VBTables) {
- StringRef VBTableName = VBTable.first;
- uint32_t Idx = 0;
- for (little32_t Offset : VBTable.second) {
- outs() << VBTableName << '[' << Idx << "]: " << Offset << '\n';
- Idx += sizeof(Offset);
- }
- }
- for (const std::pair<StringRef, CompleteObjectLocator> &COLPair : COLs) {
- StringRef COLName = COLPair.first;
- const CompleteObjectLocator &COL = COLPair.second;
- outs() << COLName << "[IsImageRelative]: " << COL.Data[0] << '\n';
- outs() << COLName << "[OffsetToTop]: " << COL.Data[1] << '\n';
- outs() << COLName << "[VFPtrOffset]: " << COL.Data[2] << '\n';
- outs() << COLName << "[TypeDescriptor]: " << COL.Symbols[0] << '\n';
- outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1] << '\n';
- }
- for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair : CHDs) {
- StringRef CHDName = CHDPair.first;
- const ClassHierarchyDescriptor &CHD = CHDPair.second;
- outs() << CHDName << "[AlwaysZero]: " << CHD.Data[0] << '\n';
- outs() << CHDName << "[Flags]: " << CHD.Data[1] << '\n';
- outs() << CHDName << "[NumClasses]: " << CHD.Data[2] << '\n';
- outs() << CHDName << "[BaseClassArray]: " << CHD.Symbols[0] << '\n';
- }
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &BCAEntry :
- BCAEntries) {
- StringRef BCAName = BCAEntry.first.first;
- uint64_t Offset = BCAEntry.first.second;
- StringRef SymName = BCAEntry.second;
- outs() << BCAName << '[' << Offset << "]: " << SymName << '\n';
- }
- for (const std::pair<StringRef, BaseClassDescriptor> &BCDPair : BCDs) {
- StringRef BCDName = BCDPair.first;
- const BaseClassDescriptor &BCD = BCDPair.second;
- outs() << BCDName << "[TypeDescriptor]: " << BCD.Symbols[0] << '\n';
- outs() << BCDName << "[NumBases]: " << BCD.Data[0] << '\n';
- outs() << BCDName << "[OffsetInVBase]: " << BCD.Data[1] << '\n';
- outs() << BCDName << "[VBPtrOffset]: " << BCD.Data[2] << '\n';
- outs() << BCDName << "[OffsetInVBTable]: " << BCD.Data[3] << '\n';
- outs() << BCDName << "[Flags]: " << BCD.Data[4] << '\n';
- outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1] << '\n';
- }
- for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) {
- StringRef TDName = TDPair.first;
- const TypeDescriptor &TD = TDPair.second;
- outs() << TDName << "[VFPtr]: " << TD.Symbols[0] << '\n';
- outs() << TDName << "[AlwaysZero]: " << TD.AlwaysZero << '\n';
- outs() << TDName << "[MangledName]: ";
- outs().write_escaped(TD.MangledName.rtrim(StringRef("\0", 1)),
- /*UseHexEscapes=*/true)
- << '\n';
- }
- for (const std::pair<StringRef, ThrowInfo> &TIPair : TIs) {
- StringRef TIName = TIPair.first;
- const ThrowInfo &TI = TIPair.second;
- auto dumpThrowInfoFlag = [&](const char *Name, uint32_t Flag) {
- outs() << TIName << "[Flags." << Name
- << "]: " << (TI.Flags & Flag ? "true" : "false") << '\n';
- };
- auto dumpThrowInfoSymbol = [&](const char *Name, int Offset) {
- outs() << TIName << '[' << Name << "]: ";
- auto Entry = TIEntries.find(std::make_pair(TIName, Offset));
- outs() << (Entry == TIEntries.end() ? "null" : Entry->second) << '\n';
- };
- outs() << TIName << "[Flags]: " << TI.Flags << '\n';
- dumpThrowInfoFlag("Const", 1);
- dumpThrowInfoFlag("Volatile", 2);
- dumpThrowInfoSymbol("CleanupFn", 4);
- dumpThrowInfoSymbol("ForwardCompat", 8);
- dumpThrowInfoSymbol("CatchableTypeArray", 12);
- }
- for (const std::pair<StringRef, CatchableTypeArray> &CTAPair : CTAs) {
- StringRef CTAName = CTAPair.first;
- const CatchableTypeArray &CTA = CTAPair.second;
-
- outs() << CTAName << "[NumEntries]: " << CTA.NumEntries << '\n';
-
- unsigned Idx = 0;
- for (auto I = CTAEntries.lower_bound(std::make_pair(CTAName, 0)),
- E = CTAEntries.upper_bound(std::make_pair(CTAName, UINT64_MAX));
- I != E; ++I)
- outs() << CTAName << '[' << Idx++ << "]: " << I->second << '\n';
- }
- for (const std::pair<StringRef, CatchableType> &CTPair : CTs) {
- StringRef CTName = CTPair.first;
- const CatchableType &CT = CTPair.second;
- auto dumpCatchableTypeFlag = [&](const char *Name, uint32_t Flag) {
- outs() << CTName << "[Flags." << Name
- << "]: " << (CT.Flags & Flag ? "true" : "false") << '\n';
- };
- outs() << CTName << "[Flags]: " << CT.Flags << '\n';
- dumpCatchableTypeFlag("ScalarType", 1);
- dumpCatchableTypeFlag("VirtualInheritance", 4);
- outs() << CTName << "[TypeDescriptor]: " << CT.Symbols[0] << '\n';
- outs() << CTName << "[NonVirtualBaseAdjustmentOffset]: "
- << CT.NonVirtualBaseAdjustmentOffset << '\n';
- outs() << CTName
- << "[VirtualBasePointerOffset]: " << CT.VirtualBasePointerOffset
- << '\n';
- outs() << CTName << "[VirtualBaseAdjustmentOffset]: "
- << CT.VirtualBaseAdjustmentOffset << '\n';
- outs() << CTName << "[Size]: " << CT.Size << '\n';
- outs() << CTName
- << "[CopyCtor]: " << (CT.Symbols[1].empty() ? "null" : CT.Symbols[1])
- << '\n';
- }
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VTTPair :
- VTTEntries) {
- StringRef VTTName = VTTPair.first.first;
- uint64_t VTTOffset = VTTPair.first.second;
- StringRef VTTEntry = VTTPair.second;
- outs() << VTTName << '[' << VTTOffset << "]: " << VTTEntry << '\n';
- }
- for (const std::pair<StringRef, StringRef> &TIPair : TINames) {
- StringRef TIName = TIPair.first;
- outs() << TIName << ": " << TIPair.second << '\n';
- }
- auto VTableSymI = VTableSymEntries.begin();
- auto VTableSymE = VTableSymEntries.end();
- auto VTableDataI = VTableDataEntries.begin();
- auto VTableDataE = VTableDataEntries.end();
- for (;;) {
- bool SymDone = VTableSymI == VTableSymE;
- bool DataDone = VTableDataI == VTableDataE;
- if (SymDone && DataDone)
- break;
- if (!SymDone && (DataDone || VTableSymI->first < VTableDataI->first)) {
- StringRef VTableName = VTableSymI->first.first;
- uint64_t Offset = VTableSymI->first.second;
- StringRef VTableEntry = VTableSymI->second;
- outs() << VTableName << '[' << Offset << "]: ";
- outs() << VTableEntry;
- outs() << '\n';
- ++VTableSymI;
- continue;
- }
- if (!DataDone && (SymDone || VTableDataI->first < VTableSymI->first)) {
- StringRef VTableName = VTableDataI->first.first;
- uint64_t Offset = VTableDataI->first.second;
- int64_t VTableEntry = VTableDataI->second;
- outs() << VTableName << '[' << Offset << "]: ";
- outs() << VTableEntry;
- outs() << '\n';
- ++VTableDataI;
- continue;
- }
- }
-}
-
-static void dumpArchive(const Archive *Arc) {
- for (const Archive::Child &ArcC : Arc->children()) {
- ErrorOr<std::unique_ptr<Binary>> ChildOrErr = ArcC.getAsBinary();
- if (std::error_code EC = ChildOrErr.getError()) {
- // Ignore non-object files.
- if (EC != object_error::invalid_file_type)
- reportError(Arc->getFileName(), EC.message());
- continue;
- }
-
- if (ObjectFile *Obj = dyn_cast<ObjectFile>(&*ChildOrErr.get()))
- dumpVTables(Obj);
- else
- reportError(Arc->getFileName(),
- vtabledump_error::unrecognized_file_format);
- }
-}
-
-static void dumpInput(StringRef File) {
- // If file isn't stdin, check that it exists.
- if (File != "-" && !sys::fs::exists(File)) {
- reportError(File, vtabledump_error::file_not_found);
- return;
- }
-
- // Attempt to open the binary.
- ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(File);
- if (std::error_code EC = BinaryOrErr.getError()) {
- reportError(File, EC);
- return;
- }
- Binary &Binary = *BinaryOrErr.get().getBinary();
-
- if (Archive *Arc = dyn_cast<Archive>(&Binary))
- dumpArchive(Arc);
- else if (ObjectFile *Obj = dyn_cast<ObjectFile>(&Binary))
- dumpVTables(Obj);
- else
- reportError(File, vtabledump_error::unrecognized_file_format);
-}
-
-int main(int argc, const char *argv[]) {
- sys::PrintStackTraceOnErrorSignal();
- PrettyStackTraceProgram X(argc, argv);
- llvm_shutdown_obj Y;
-
- // Initialize targets.
- llvm::InitializeAllTargetInfos();
-
- // Register the target printer for --version.
- cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
-
- cl::ParseCommandLineOptions(argc, argv, "LLVM VTable Dumper\n");
-
- // Default to stdin if no filename is specified.
- if (opts::InputFilenames.size() == 0)
- opts::InputFilenames.push_back("-");
-
- std::for_each(opts::InputFilenames.begin(), opts::InputFilenames.end(),
- dumpInput);
-
- return ReturnValue;
-}
Removed: llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h?rev=232300&view=auto
==============================================================================
--- llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h (original)
+++ llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.h (removed)
@@ -1,23 +0,0 @@
-//===-- llvm-vtabledump.h ---------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
-
-#include "llvm/Support/CommandLine.h"
-#include <string>
-
-namespace opts {
-extern llvm::cl::list<std::string> InputFilenames;
-} // namespace opts
-
-#define LLVM_VTABLEDUMP_ENUM_ENT(ns, enum) \
- { #enum, ns::enum }
-
-#endif
More information about the llvm-commits
mailing list