aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ModuleBuilder.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-10-08[MSVC Compat] Enable ABI impacting non-conforming behavior independently of ↵David Majnemer1-1/+1
-fms-compatibility No ABI for C++ currently makes it possible to implement the standard 100% perfectly. We wrongly hid some of our compatible behavior behind -fms-compatibility instead of tying it to the compiler ABI. llvm-svn: 249656
2015-08-05Rename DescriptionString -> DataLayoutString as it matches the actualEric Christopher1-1/+1
use of the string. llvm-svn: 244178
2015-07-24LLVM API Change: the Module always owns the DataLayoutMehdi Amini1-8/+3
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243115
2015-06-30Pass HeaderSearchOptions and PreprocessorOptions into CodeGenModule.Adrian Prantl1-12/+21
In order to produce debug info for clang modules CGDebugInfo it needs access to macros passed on the command line and the isysroot. llvm-svn: 241035
2015-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko1-1/+1
llvm-svn: 240353
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-1/+1
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko1-1/+1
Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
2015-01-17Wrap to 80 columns. No behavior change.Nico Weber1-1/+2
llvm-svn: 226364
2015-01-15Remove unused parameter, followup to r179639. No behavior change.Nico Weber1-1/+0
llvm-svn: 226128
2015-01-15Remove ASTConsumer::HandleVTable()'s bool parameter.Nico Weber1-2/+2
Sema calls HandleVTable() with a bool parameter which is then threaded through three layers. The only effect of this bool is an early return at the last layer. Instead, remove this parameter and call HandleVTable() only if the bool is true. No intended behavior change. llvm-svn: 226096
2014-12-25Initialize CodeGeneratorImpl::Ctx in constructor.Yaron Keren1-1/+1
llvm-svn: 224835
2014-12-19Tweak the assert in ModuleBuilder from r224533 (PR21989)Hans Wennborg1-2/+3
Turns out there will be left-over deferred inline methods if there have been errors, because in that case HandleTopLevelDecl bails out early. llvm-svn: 224649
2014-12-18ModuleBuilder: assert that all deferred inline method defs get handledHans Wennborg1-4/+7
While we're here, also move the declaration of DeferredInlineMethodDefinitions closer to the other member vars and make it a SmallVector. NFC. llvm-svn: 224533
2014-11-18InstrProf: Don't emit coverage for uninstantiated templatesJustin Bogner1-3/+5
We include unused functions and methods in -fcoverage-mapping so that we can differentiate between uninstrumented and unused. This can cause problems for uninstantiated templates though, since they may involve an incomplete type that can't be mangled. This shows up in things like libc++'s <unordered_map> and makes coverage unusable. Avoid the issue by skipping uninstantiated methods of a templated class. llvm-svn: 222204
2014-08-13[modules] Fix a rejects-valid resulting from emitting an inline functionRichard Smith1-1/+5
recursively within the emission of another inline function. This ultimately led to us emitting the same inline function definition twice, which we then rejected because we believed we had a mangled name conflict. llvm-svn: 215579
2014-08-04Add coverage mapping generation.Alex Lorenz1-4/+13
This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). llvm-svn: 214752
2014-08-01Notional simplification: defer emitting deferred inline methods until we finishRichard Smith1-4/+21
emitting everything, rather than potentially doing this reentrantly. llvm-svn: 214582
2014-08-01Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.Richard Smith1-3/+5
Original message: Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap. llvm-svn: 214555
2014-08-01Revert r214547 due to test breakage.Richard Smith1-6/+3
llvm-svn: 214549
2014-08-01Fix iterator invalidation issues that are breaking my modules buildbot's ↵Richard Smith1-3/+6
bootstrap. llvm-svn: 214547
2014-07-17MS compatibility: always emit dllexported in-class initialized static data ↵Hans Wennborg1-0/+13
members (PR20140) This makes us emit dllexported in-class initialized static data members (which are treated as definitions in MSVC), even when they're not referenced. It also makes their special linkage reflected in the GVA linkage instead of getting massaged in CodeGen. Differential Revision: http://reviews.llvm.org/D4563 llvm-svn: 213304
2014-06-06Defer codegen of inline method definitions to the end of current top level ↵Hans Wennborg1-6/+18
declaration We would previously fail to emit a definition of bar() for the following code: struct __declspec(dllexport) S { void foo() { t->bar(); } struct T { void bar() {} }; T *t; }; Note that foo() is an exported method, but bar() is not. However, foo() refers to bar() so we need to emit its definition. We would previously fail to realise that bar() is used. By deferring the method definitions until the end of the top level declaration, we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms to decide whether the method should be emitted or not. Differential Revision: http://reviews.llvm.org/D4038 llvm-svn: 210356
2014-06-05Implement -Wframe-larger-than backend diagnosticAlp Toker1-0/+15
Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning. This is the first GCC-compatible backend diagnostic built around LLVM's reporting feature. This commit adds infrastructure to perform reverse lookup from mangled names emitted after LLVM IR generation. We use that to resolve precise locations and originating AST functions, lambdas or block declarations to produce seamless codegen-guided diagnostics. An associated change, StringMap now maintains unique mangled name strings instead of allocating copies. This is a net memory saving in C++ and a small hit for C where we no longer reuse IdentifierInfo storage, pending further optimisation. llvm-svn: 210293
2014-05-23Emit used/dllexport inline method definitions in nested classes (PR19743, ↵Hans Wennborg1-11/+14
PR11170) The previous code that was supposed to handle this didn't work since parsing of inline method definitions is delayed to the end of the outer class definition. Thus, when HandleTagDeclDefinition() got called for the inner class, the inline functions in that class had not been parsed yet. Richard suggested that the way to do this is by handling inline method definitions through a new ASTConsumer callback. I really wanted to call ASTContext::DeclMustBeEmitted() instead of checking for attributes, but doing that causes us to compute linkage, and then we fail with "error: unsupported: typedef changes linkage of anonymous type, but linkage was already computed" on tests like this: (from SemaCXX/undefined-internal.cpp) :-/ namespace test7 { typedef struct { void bar(); void foo() { bar(); } } A; } Differential Revision: http://reviews.llvm.org/D3809 llvm-svn: 209549
2014-03-12[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-14/+14
class. llvm-svn: 203643
2014-03-09[C++11] Replace OwningPtr include with <memory>.Ahmed Charles1-1/+1
llvm-svn: 203389
2014-03-07Replace OwningPtr with std::unique_ptr.Ahmed Charles1-3/+4
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
2014-03-07[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman1-4/+2
iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
2014-03-07Change OwningPtr::take() to OwningPtr::release().Ahmed Charles1-3/+1
This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
2014-03-02Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper1-1/+1
llvm-svn: 202625
2014-01-07Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth1-1/+1
encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
2013-12-09When we decide to output a deferred decl, remember the llvm GlobalValue.Rafael Espindola1-0/+2
We can reuse it to avoid a DenseMap+StringMap lookup to find if it was already emitted or not. This fixes a 2010 TODO. llvm-svn: 196785
2013-08-19PR16933: Don't try to codegen things after we've seen errors.David Blaikie1-0/+12
Refactor the underlying code a bit to remove unnecessary calls to "hasErrorOccurred" & make them consistently at all the entry points to the IRGen ASTConsumer. llvm-svn: 188707
2013-08-15DebugInfo: Unify & optimize the lazy addition of record typesDavid Blaikie1-1/+1
Rather than going through the whole getOrCreateType machinery to manifest a type, cut straight to the implementation because we know we have to do work. While the previous implementation was sufficient for the two cases (completeness and required completeness) we have already (the general machinery could inspect the type for those attributes & go down the full definition path), a pending change (to emit info for types when we emit their vtables) won't have that luxury & we'll need to force the creation rather than relying on the general purpose routine. llvm-svn: 188486
2013-08-08clang-cl: Support the run-time selection options (/MD, /MT et al.)Hans Wennborg1-0/+3
These flags set some preprocessor macros and injects a dependency on the runtime library into the object file, which later is picked up by the linker. This also adds a new CC1 flag for adding a dependent library. Differential Revision: http://llvm-reviews.chandlerc.com/D1315 llvm-svn: 187945
2013-07-13PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to ↵David Blaikie1-0/+7
emit the full definition of a type in -flimit-debug-info This simplifies the core benefit of -flimit-debug-info by taking a more systematic approach to avoid emitting debug info definitions for types that only require declarations. The previous ad-hoc approach (3 cases removed in this patch) had many holes. The general approach (adding a bit to TagDecl and callback through ASTConsumer) has been discussed with Richard Smith - though always open to revision. llvm-svn: 186262
2013-06-04Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman1-0/+5
FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
2013-05-08Forward #pragma comment(lib/linker) through as flags metadataReid Kleckner1-0/+9
Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight. Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern. LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible. This is related to auto-linking, which is http://llvm.org/PR13016. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D723 llvm-svn: 181426
2013-04-16Don't propagate around TargetOptions in IR-gen; we don't use it.John McCall1-8/+6
Patch by Stephen Lin! llvm-svn: 179639
2013-02-14Pass the target options through to code generation.Bill Wendling1-4/+8
The code generation stuff is going to set attributes on the functions it generates. To do that it needs the target options. Pass them through. llvm-svn: 175141
2013-01-02Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth1-3/+3
reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-3/+3
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-10-08Move TargetData to DataLayout.Micah Villmow1-3/+3
llvm-svn: 165395
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-1/+1
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-08Replace MarkVarRequired with a more genericRafael Espindola1-2/+2
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios. llvm-svn: 152320
2012-03-05Fix a small difference in sema and codegen views of what needs to be output.Rafael Espindola1-0/+4
In the included testcase, soma thinks that we already have a definition after we see the out of line decl. Codegen puts it in a deferred list, to be output if a use is seen. This would break when we saw an explicit template instantiation definition, since codegen would not be notified. This patch adds a method to the consumer interface so that soma can notify codegen that this decl is now required. llvm-svn: 152024
2012-02-05Basic: import OwningPtr<> into clang namespaceDylan Noblesmith1-3/+3
llvm-svn: 149798
2011-12-20Unweaken vtables as per ↵David Blaikie1-0/+2
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
2011-11-18Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis1-1/+2
parsing or false to abort parsing. llvm-svn: 144943
2011-09-25Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie1-3/+3
llvm-svn: 140478