llvm-project/clang/lib/Frontend/CMakeLists.txt

59 lines
1.2 KiB
CMake
Raw Normal View History

add_clang_library(clangFrontend
ASTConsumers.cpp
ASTMerge.cpp
2009-06-24 06:01:29 +08:00
ASTUnit.cpp
CacheTokens.cpp
ChainedDiagnosticConsumer.cpp
ChainedIncludesSource.cpp
CompilerInstance.cpp
CompilerInvocation.cpp
CreateInvocationFromCommandLine.cpp
DependencyFile.cpp
DependencyGraph.cpp
DiagnosticRenderer.cpp
FrontendAction.cpp
FrontendActions.cpp
FrontendOptions.cpp
HeaderIncludeGen.cpp
InitHeaderSearch.cpp
InitPreprocessor.cpp
LangStandards.cpp
Extend the ExternalASTSource interface to allow the AST source to provide the layout of records, rather than letting Clang compute the layout itself. LLDB provides the motivation for this feature: because various layout-altering attributes (packed, aligned, etc.) don't get reliably get placed into DWARF, the record layouts computed by LLDB from the reconstructed records differ from the actual layouts, and badness occurs. This interface lets the DWARF data drive layout, so we don't need the attributes preserved to get the answer write. The testing methodology for this change is fun. I've introduced a variant of -fdump-record-layouts called -fdump-record-layouts-simple that always has the simple C format and provides size/alignment/field offsets. There is also a -cc1 option -foverride-record-layout=<file> to take the output of -fdump-record-layouts-simple and parse it to produce a set of overridden layouts, which is introduced into the AST via a testing-only ExternalASTSource (called LayoutOverrideSource). Each test contains a number of records to lay out, which use various layout-changing attributes, and then dumps the layouts. We then run the test again, using the preprocessor to eliminate the layout-changing attributes entirely (which would give us different layouts for the records), but supplying the previously-computed record layouts. Finally, we diff the layouts produced from the two runs to be sure that they are identical. Note that this code makes the assumption that we don't *have* to provide the offsets of bases or virtual bases to get the layout right, because the alignment attributes don't affect it. I believe this assumption holds, but if it does not, we can extend LayoutOverrideSource to also provide base offset information. Fixes the Clang side of <rdar://problem/10169539>. llvm-svn: 149055
2012-01-26 15:55:45 +08:00
LayoutOverrideSource.cpp
LogDiagnosticPrinter.cpp
2011-01-26 06:10:37 +08:00
MultiplexConsumer.cpp
PrintPreprocessedOutput.cpp
SerializedDiagnosticPrinter.cpp
TextDiagnostic.cpp
TextDiagnosticBuffer.cpp
TextDiagnosticPrinter.cpp
VerifyDiagnosticConsumer.cpp
Warnings.cpp
)
add_dependencies(clangFrontend
ClangAttrClasses
ClangAttrList
ClangAttrParsedAttrList
ClangCommentNodes
ClangDeclNodes
ClangDiagnosticAST
ClangDiagnosticCommon
ClangDiagnosticDriver
ClangDiagnosticFrontend
ClangDiagnosticLex
2010-05-05 13:41:05 +08:00
ClangDiagnosticSema
ClangDriverOptions
ClangStmtNodes
)
target_link_libraries(clangFrontend
clangAST
clangBasic
clangDriver
clangEdit
clangLex
clangParse
clangSema
clangSerialization
)