summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ModuleBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Use -main-file-name for source filename if not setTeresa Johnson2019-09-301-2/+10
| | | | | | | | | | | | | | | | | | | -main-file-name is currently used to set the source name used in debug information. If the source filename is "-" and -main-file-name is set, then use the filename also for source_filename and ModuleID of the output. The argument is generally used outside the internal clang calls when running clang in a wrapper like icecc which gives the source via stdin but still wants to get a object file with the original source filename both in debug info and IR code. Patch by: the_jk (Joel Klinghed) Differential Revision: https://reviews.llvm.org/D67592 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373217 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP 5.0] Codegen support for user-defined mappers.Michael Kruse2019-08-051-0/+3
| | | | | | | | | | | | | | | | | | | This patch implements the code generation for OpenMP 5.0 declare mapper (user-defined mapper) constructs. For each declare mapper, a mapper function is generated. These mapper functions will be called by the runtime and/or other mapper functions to achieve user defined mapping. The design slides can be found at https://github.com/lingda-li/public-sharing/blob/master/mapper_runtime_design.pptx Re-commit after revert in r367773 because r367755 changed the LLVM-IR output such that a CHECK line failed. Patch by Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D59474 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367905 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[OpenMP 5.0] Codegen support for user-defined mappers."Michael Kruse2019-08-041-3/+0
| | | | | | | This reverts commit r367773. The test case OpenMP/declare_mapper_codegen.cpp is failing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367774 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP 5.0] Codegen support for user-defined mappers.Michael Kruse2019-08-041-0/+3
| | | | | | | | | | | | | | | | This patch implements the code generation for OpenMP 5.0 declare mapper (user-defined mapper) constructs. For each declare mapper, a mapper function is generated. These mapper functions will be called by the runtime and/or other mapper functions to achieve user defined mapping. The design slides can be found at https://github.com/lingda-li/public-sharing/blob/master/mapper_runtime_design.pptx Patch by Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D59474 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367773 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [darwin] parse the SDK settings from SDKSettings.json if it exists andAlex Lorenz2018-12-171-0/+3
| | | | | | | | | | | | | | | | | | | | | pass in the -target-sdk-version to the compiler and backend This commit adds support for reading the SDKSettings.json file in the Darwin driver. This file is used by the driver to determine the SDK's version, and it uses that information to pass it down to the compiler using the new -target-sdk-version= option. This option is then used to set the appropriate SDK Version module metadata introduced in r349119. Note: I had to adjust the two ast tests as the SDKROOT environment variable on macOS caused SDK version to be picked up for the compilation of source file but not the AST. rdar://45774000 Differential Revision: https://reviews.llvm.org/D55673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349380 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CodeGenOptions from Frontend to BasicRichard Trieu2018-12-111-1/+1
| | | | | | | Basic uses CodeGenOptions and should not depend on Frontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348827 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS] Defer dllexport inline friend functions like other inline methodsReid Kleckner2018-09-181-20/+9
| | | | | | | | | | | | | | | This special case was added in r264841, but the code breaks our invariants by calling EmitTopLevelDecl without first creating a HandlingTopLevelDeclRAII scope. This fixes the PCH crash in https://crbug.com/884427. I was never able to make a satisfactory reduction, unfortunately. I'm not very worried about this regressing since this change makes the code simpler while passing the existing test that shows we do emit dllexported friend function definitions. Now we just defer their emission until the tag is fully complete, which is generally good. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342516 91177308-0d34-0410-b5e6-96231b3b80d8
* D34444: Teach codegen to work in incremental processing mode.Vassil Vassilev2017-08-271-0/+13
| | | | | | | | | | | | | | | When isIncrementalProcessingEnabled is on we might want to produce multiple llvm::Modules. This patch allows the clients to start a new llvm::Module, allowing CodeGen to continue working after a HandleEndOfTranslationUnit call. This should give the necessary facilities to write a unittest for D34059. As discussed in the review this is meant to give us a way to proceed forward in our efforts to upstream our interpreter-related patches. The design of this will likely change soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311843 91177308-0d34-0410-b5e6-96231b3b80d8
* [Coverage] Don't emit mappings for functions in dependent contexts (fixes ↵Vedant Kumar2017-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR32679) The coverage implementation marks functions which won't be emitted as 'deferred', so that it can emit empty coverage regions for them later (once their linkages are known). Functions in dependent contexts are an exception: if there isn't a full instantiation of a function, it shouldn't be marked 'deferred'. We've been breaking that rule without much consequence because we just ended up with useless, extra, empty coverage mappings. With PR32679, this behavior finally caused a crash, because clang marked a partial template specialization as 'deferred', causing the MS mangler to choke in its delayed-template-parsing mode: error: cannot mangle this template type parameter type yet (http://bugs.llvm.org/show_bug.cgi?id=32679) Fix this by checking if a decl's context is a dependent context before marking it 'deferred'. Based on a patch by Adam Folwarczny! Differential Revision: https://reviews.llvm.org/D32144 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300723 91177308-0d34-0410-b5e6-96231b3b80d8
* [DebugInfo] Added support to Clang FE for generating debug info for ↵Amjad Aboud2017-02-091-0/+8
| | | | | | | | | | | preprocessor macros. Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info. Added CC1 "-debug-info-macro" flag that enables emitting macro debug info. Differential Revision: https://reviews.llvm.org/D16135 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294637 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a type-safe enum for ForDefinition.John McCall2016-11-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288289 91177308-0d34-0410-b5e6-96231b3b80d8
* Various improvements to the public IRGen interface.John McCall2016-05-181-5/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269880 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug involving deferred decl emission and PCHReid Kleckner2016-04-221-2/+18
| | | | | | | | | | | | | | | | For various reasons, involving dllexport and class linkage compuations, we have to wait until after the semicolon after a class declaration to emit inline methods. These are "deferred" decls. Before this change, finishing the tag decl would trigger us to deserialize some PCH so that we could make a "pretty" IR-level type. Deserializing the PCH triggered calls to HandleTopLevelDecl, which, when done, checked the deferred decl list, and emitted some dllexported decls that weren't ready. Avoid this re-entrancy. Deferred decls should not get emitted when a tag is finished, they should only be emitted after a real top level decl in the main file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267186 91177308-0d34-0410-b5e6-96231b3b80d8
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-081-3/+1
| | | | | | | | | | | Revert the two changes to thread CodeGenOptions into the TargetInfo allocation and to fix the layering violation by moving CodeGenOptions into Basic. Code Generation is arguably not particularly "basic". This addresses Richard's post-commit review comments. This change purely does the mechanical revert and will be followed up with an alternate approach to thread the desired information into TargetInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265806 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: move CodeGenOptions from FrontendSaleem Abdulrasool2016-04-071-1/+3
| | | | | | | | This is a mechanical move of CodeGenOptions from libFrontend to libBasic. This fixes the layering violation introduced earlier by threading CodeGenOptions into TargetInfo. It should also fix the modules based self-hosting builds. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265702 91177308-0d34-0410-b5e6-96231b3b80d8
* For MS ABI, emit dllexport friend functions defined inline in classStephan Bergmann2016-03-301-4/+15
| | | | | | | | | | | | | | | ...as that is apparently what MSVC does. This is an updated version of r263738, which had to be reverted in r263740 due to test failures. The original version had erroneously emitted functions that are defined in class templates, too (see the updated "Handle friend functions" code in EmitDeferredDecls, lib/CodeGen/ModuleBuilder.cpp). (The updated tests needed to be split out into their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have interfered with subsequent CHECK-DAGs in dllexport.cpp.) Differential Revision: http://reviews.llvm.org/D18430 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264841 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "For MS ABI, emit dllexport friend functions defined inline in class"Reid Kleckner2016-03-171-14/+4
| | | | | | | | | This reverts commit r263738. This appears to cause a failure in CXX/temp/temp.decls/temp.friend/p1.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263740 91177308-0d34-0410-b5e6-96231b3b80d8
* For MS ABI, emit dllexport friend functions defined inline in classReid Kleckner2016-03-171-4/+14
| | | | | | | | | | | | Summary: ...as that is apparently what MSVC does Reviewers: rnk Patch by Stephan Bergmann Differential Revision: http://reviews.llvm.org/D15267 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263738 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-131-2/+3
| | | | | | | | | | | | | | | | | | | | | -discard-value-names option Summary: This flag is enabled by default in the driver when NDEBUG is set. It is forwarded on the LLVMContext to discard all value names (but GlobalValue) for performance purpose. This an improved version of D18024 Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18127 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263394 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TargetInfo store an actual DataLayout instead of a string.James Y Knight2016-03-041-1/+1
| | | | | | | | | | | | | | Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262737 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.0] Codegen for 'declare reduction' construct.Alexey Bataev2016-03-041-0/+9
| | | | | | | Emit function for 'combiner' part of 'declare reduction' construct and 'initialilzer' part, if any. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262699 91177308-0d34-0410-b5e6-96231b3b80d8
* Serialize `#pragma detect_mismatch`.Nico Weber2016-03-021-5/+0
| | | | | | | | This is like r262493, but for pragma detect_mismatch instead of pragma comment. The two pragmas have similar behavior, so use the same approach for both. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262506 91177308-0d34-0410-b5e6-96231b3b80d8
* Serialize `#pragma comment`.Nico Weber2016-03-021-10/+2
| | | | | | | | | | | | | | | `#pragma comment` was handled by Sema calling a function on ASTConsumer, and CodeGen then implementing this function and writing things to its output. Instead, introduce a PragmaCommentDecl AST node and hang one off the TranslationUnitDecl for every `#pragma comment` line, and then use the regular serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's eagerly deserialized.) http://reviews.llvm.org/D17799 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262493 91177308-0d34-0410-b5e6-96231b3b80d8
* Check for frontend errors after releasing the Builder.Manman Ren2016-01-281-3/+6
| | | | | | | | | | | | | | Frontend can emit errors when releaseing the Builder. If there are errors before or when releasing the Builder, we reset the module to stop here before invoking the backend. Before this commit, clang will continue to invoke the backend and backend can crash. Differential Revision: http://reviews.llvm.org/D16564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259116 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS ABI] Allow a member pointers' converted type to changeDavid Majnemer2016-01-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Member pointers in the MS ABI are tricky for a variety of reasons. The size of a member pointer is indeterminate until the program reaches a point where the representation is required to be known. However, *pointers* to member pointers may exist without knowing the pointee type's representation. In these cases, we synthesize an opaque LLVM type for the pointee type. However, we can be in a situation where the underlying member pointer's representation became known mid-way through the program. To account for this, we attempted to manicure CodeGen's type-cache so that we can replace the opaque member pointer type with the real deal while leaving the pointer types unperturbed. This, unfortunately, is a problematic approach to take as we will violate CodeGen's invariants. These violations are mostly harmless but let's do the right thing instead: invalidate the type-cache if a member pointer's LLVM representation changes. This fixes PR26313. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258839 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce -fsanitize-stats flag.Peter Collingbourne2016-01-161-3/+5
| | | | | | | | | This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16175 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257971 91177308-0d34-0410-b5e6-96231b3b80d8
* [MSVC Compat] Enable ABI impacting non-conforming behavior independently of ↵David Majnemer2015-10-081-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249656 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DescriptionString -> DataLayoutString as it matches the actualEric Christopher2015-08-051-1/+1
| | | | | | use of the string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244178 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVM API Change: the Module always owns the DataLayoutMehdi Amini2015-07-241-8/+3
| | | | | | From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243115 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass HeaderSearchOptions and PreprocessorOptions into CodeGenModule.Adrian Prantl2015-06-301-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241035 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234678 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap to 80 columns. No behavior change.Nico Weber2015-01-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226364 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused parameter, followup to r179639. No behavior change.Nico Weber2015-01-151-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226128 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ASTConsumer::HandleVTable()'s bool parameter.Nico Weber2015-01-151-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226096 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize CodeGeneratorImpl::Ctx in constructor.Yaron Keren2014-12-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224835 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the assert in ModuleBuilder from r224533 (PR21989)Hans Wennborg2014-12-191-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224649 91177308-0d34-0410-b5e6-96231b3b80d8
* ModuleBuilder: assert that all deferred inline method defs get handledHans Wennborg2014-12-181-4/+7
| | | | | | | While we're here, also move the declaration of DeferredInlineMethodDefinitions closer to the other member vars and make it a SmallVector. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224533 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Don't emit coverage for uninstantiated templatesJustin Bogner2014-11-181-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222204 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix a rejects-valid resulting from emitting an inline functionRichard Smith2014-08-131-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215579 91177308-0d34-0410-b5e6-96231b3b80d8
* Add coverage mapping generation.Alex Lorenz2014-08-041-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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214752 91177308-0d34-0410-b5e6-96231b3b80d8
* Notional simplification: defer emitting deferred inline methods until we finishRichard Smith2014-08-011-4/+21
| | | | | | | emitting everything, rather than potentially doing this reentrantly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214582 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.Richard Smith2014-08-011-3/+5
| | | | | | | | | | Original message: Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214555 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r214547 due to test breakage.Richard Smith2014-08-011-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214549 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix iterator invalidation issues that are breaking my modules buildbot's ↵Richard Smith2014-08-011-3/+6
| | | | | | bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214547 91177308-0d34-0410-b5e6-96231b3b80d8
* MS compatibility: always emit dllexported in-class initialized static data ↵Hans Wennborg2014-07-171-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213304 91177308-0d34-0410-b5e6-96231b3b80d8
* Defer codegen of inline method definitions to the end of current top level ↵Hans Wennborg2014-06-061-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210356 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -Wframe-larger-than backend diagnosticAlp Toker2014-06-051-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210293 91177308-0d34-0410-b5e6-96231b3b80d8