summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR0091R3: Implement parsing support for using templates as types.Richard Smith2017-01-261-1/+3
| | | | | | | | | | | | | | | This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type. This is modeled around AutoType, and shares a common base class for representing a deduced placeholder type. We allow deduced class template types in a few more places than the standard does: in conditions and for-range-declarators, and in new-type-ids. This is consistent with GCC and with discussion on the core reflector. This patch does not yet support deduced class template types being named in typename specifiers. llvm-svn: 293207
* [OPENMP] Fix for PR31643: Clang crashes when compiling code on WindowsAlexey Bataev2017-01-201-2/+1
| | | | | | | | | | with SEH and openmp In some cituations (during codegen for Windows SEH constructs) CodeGenFunction instance may have CurFn equal to nullptr. OpenMP related code does not expect such situation during cleanup. llvm-svn: 292590
* [tsan] Do not report errors in __destroy_helper_block_Anna Zaks2017-01-131-3/+11
| | | | | | | | | | There is a synchronization point between the reference count of a block dropping to zero and it's destruction, which TSan does not observe. Do not report errors in the compiler-emitted block destroy method and everything called from it. This is similar to https://reviews.llvm.org/D25857 Differential Revision: https://reviews.llvm.org/D28387 llvm-svn: 291868
* Add a cc1 option to force disabling lifetime-markers emission from clangMehdi Amini2017-01-061-0/+3
| | | | | | | | Summary: This intended as a debugging/development flag only. Differential Revision: https://reviews.llvm.org/D28385 llvm-svn: 291300
* Add -f[no-]strict-return flag that can be used to avoid undefined behaviourAlex Lorenz2017-01-041-4/+23
| | | | | | | | | | | | | | | | | | | | | | | in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-231-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fno-inline-functions, -O0, and optnone. These were really, really tangled together: - We used the noinline LLVM attribute for -fno-inline - But not for -fno-inline-functions (breaking LTO) - But we did use it for -finline-hint-functions (yay, LTO is happy!) - But we didn't for -O0 (LTO is sad yet again...) - We had weird structuring of CodeGenOpts with both an inlining enumeration and a boolean. They interacted in weird ways and needlessly. - A *lot* of set smashing went on with setting these, and then got worse when we considered optnone and other inlining-effecting attributes. - A bunch of inline affecting attributes were managed in a completely different place from -fno-inline. - Even with -fno-inline we failed to put the LLVM noinline attribute onto many generated function definitions because they didn't show up as AST-level functions. - If you passed -O0 but -finline-functions we would run the normal inliner pass in LLVM despite it being in the O0 pipeline, which really doesn't make much sense. - Lastly, we used things like '-fno-inline' to manipulate the pass pipeline which forced the pass pipeline to be much more parameterizable than it really needs to be. Instead we can *just* use the optimization level to select a pipeline and control the rest via attributes. Sadly, this causes a bunch of churn in tests because we don't run the optimizer in the tests and check the contents of attribute sets. It would be awesome if attribute sets were a bit more FileCheck friendly, but oh well. I think this is a significant improvement and should remove the semantic need to change what inliner pass we run in order to comply with the requested inlining semantics by relying completely on attributes. It also cleans up tho optnone and related handling a bit. One unfortunate aspect of this is that for generating alwaysinline routines like those in OpenMP we end up removing noinline and then adding alwaysinline. I tried a bunch of other approaches, but because we recompute function attributes from scratch and don't have a declaration here I couldn't find anything substantially cleaner than this. Differential Revision: https://reviews.llvm.org/D28053 llvm-svn: 290398
* [clang] Version support for UBSan handlersFilipe Cabecinhas2016-12-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | This adds a way for us to version any UBSan handler by itself. The patch overrides D21289 for a better implementation (we're able to rev up a single handler). After this, then we can land a slight modification of D19667+D19668. We probably don't want to keep all the versions in compiler-rt (maybe we want to deprecate on one release and remove the old handler on the next one?), but with this patch we will loudly fail to compile when mixing incompatible handler calls, instead of silently compiling and then providing bad error messages. Reviewers: kcc, samsonov, rsmith, vsk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21695 llvm-svn: 289444
* [OpenCL] always use SPIR address spaces for kernel_arg_addr_space MDPekka Jaaskelainen2016-11-141-3/+19
| | | | | | | | | | | | | | | It doesn't make sense to use the target's address space ids in this context as this is metadata that should be referring to the "logical" OpenCL address spaces. For flat AS machines like all "CPUs" in general, the logical AS info gets lost as there's only one address space (0). This commit changes the logic such that we always use the SPIR address space ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo() and the other detection needs. https://reviews.llvm.org/D26157 llvm-svn: 286819
* [tsan][clang] Introduce a function attribute to disable TSan checking at run ↵Anna Zaks2016-11-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | time This introduces a function annotation that disables TSan checking for the function at run time. The benefit over attribute((no_sanitize("thread"))) is that the accesses within the callees will also be suppressed. The motivation for this attribute is a guarantee given by the objective C language that the calls to the reference count decrement and object deallocation will be synchronized. To model this properly, we would need to intercept all ref count decrement calls (which are very common in ObjC due to use of ARC) and also every single message send. Instead, we propose to just ignore all accesses made from within dealloc at run time. The main downside is that this still does not introduce any synchronization, which means we might still report false positives if the code that relies on this synchronization is not executed from within dealloc. However, we have not seen this in practice so far and think these cases will be very rare. (This problem is similar in nature to https://reviews.llvm.org/D21609; unfortunately, the same solution does not apply here.) Differential Revision: https://reviews.llvm.org/D25857 llvm-svn: 286672
* Add the loop end location to the loop metadata. This additional informationAmara Emerson2016-11-101-0/+7
| | | | | | | | | | | | can be used to improve the locations when generating remarks for loops. Depends on the companion LLVM change r286227. Patch by Florian Hahn. Differential Revision: https://reviews.llvm.org/D25764 llvm-svn: 286456
* [CodeGen] Don't emit lifetime intrinsics for some local variablesVitaly Buka2016-10-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Current generation of lifetime intrinsics does not handle cases like: ``` { char x; l1: bar(&x, 1); } goto l1; ``` We will get code like this: ``` %x = alloca i8, align 1 call void @llvm.lifetime.start(i64 1, i8* nonnull %x) br label %l1 l1: %call = call i32 @bar(i8* nonnull %x, i32 1) call void @llvm.lifetime.end(i64 1, i8* nonnull %x) br label %l1 ``` So the second time bar was called for x which is marked as dead. Lifetime markers here are misleading so it's better to remove them at all. This type of bypasses are rare, e.g. code detects just 8 functions building clang (2329 targets). PR28267 Reviewers: eugenis Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24693 llvm-svn: 285176
* [CodeGen] Move shouldEmitLifetimeMarkers into more convenient placeVitaly Buka2016-10-261-10/+27
| | | | | | | | | | | | Summary: D24693 will need access to it from other places Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24695 llvm-svn: 285158
* Fix a couple of wrong-code bugs in switch-on-constant optimization:Richard Smith2016-09-161-0/+23
| | | | | | | | | | | | * recurse through intermediate LabelStmts and AttributedStmts when checking whether a statement inside a switch declares a variable * if the end of a compound statement is reachable from the chosen case label, and the compound statement contains a variable declaration, it's not valid to just emit the contents of the compound statement -- we must emit the statement itself or we lose the scope (and thus end lifetimes at the wrong point) llvm-svn: 281797
* ObjectiveC generics: Add ObjCTypeParamType in the type system.Manman Ren2016-09-131-0/+1
| | | | | | | | | | | | | | | | | We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the representation of "T <protocol>" where T is a type parameter. Before this, we use TypedefType to represent the type parameter for ObjC. ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized to the underlying type with the protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23079 llvm-svn: 281355
* Update Clang for D20147 ("DebugInfo: New metadata representation for global ↵Peter Collingbourne2016-09-131-2/+2
| | | | | | | | variables.") Differential Revision: http://reviews.llvm.org/D20415 llvm-svn: 281285
* [OpenCL] Remove access qualifiers on images in arg info metadata.Alexey Bader2016-09-061-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Remove access qualifiers on images in arg info metadata: * kernel_arg_type * kernel_arg_base_type Image access qualifiers are inseparable from type in clang implementation, but OpenCL spec provides a special query to get access qualifier via clGetKernelArgInfo with CL_KERNEL_ARG_ACCESS_QUALIFIER. Besides that OpenCL conformance test_api get_kernel_arg_info expects image types without access qualifier. Patch by Evgeniy Tyurin. Reviewers: bader, yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23915 llvm-svn: 280699
* [Frontend] Fix mcount inlining bugHonggyu Kim2016-09-011-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Since some profiling tools, such as gprof, ftrace, and uftrace, use -pg option to generate a mcount function call at the entry of each function. Function invocation can be detected by this hook function. But mcount insertion is done before function inlining phase in clang, sometime a function that already has a mcount call can be inlined in the middle of another function. This patch adds an attribute "counting-function" to each function rather than emitting the mcount call directly in frontend so that this attribute can be processed in backend. Then the mcount calls can be properly inserted in backend after all the other optimizations are completed. Link: https://llvm.org/bugs/show_bug.cgi?id=28660 Reviewers: hans, rjmccall, hfinkel, rengolin, compnerd Subscribers: shenhan, cfe-commits Differential Revision: https://reviews.llvm.org/D22666 llvm-svn: 280355
* Remove whitespace to test commit accessHonggyu Kim2016-09-011-1/+1
| | | | llvm-svn: 280337
* Add XRay flags to Clang. We implement two flags to control the XRay behaviour:Aaron Ballman2016-07-131-0/+20
| | | | | | | | | | | -fxray-instrument: enables XRay annotation of IR -fxray-instruction-threshold: configures the threshold for function size (looking at IR instructions), and allow LLVM to decide whether to add the nop sleds later on in the process. Also implements the related xray_always_instrument and xray_never_instrument function attributes. Patch by Dean Michael Berris. llvm-svn: 275330
* [OpenCL] Fix code generation of kernel pipe parameters.Alexey Bader2016-07-131-3/+5
| | | | | | | | | | | Improved test with user define structure pipe type case. Reviewers: Anastasia, pxli168 Subscribers: yaxunl, cfe-commits Differential revision: http://reviews.llvm.org/D21744 llvm-svn: 275259
* P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:Richard Smith2016-06-281-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace inheriting constructors implementation with new approach, voted into C++ last year as a DR against C++11. Instead of synthesizing a set of derived class constructors for each inherited base class constructor, we make the constructors of the base class visible to constructor lookup in the derived class, using the normal rules for using-declarations. For constructors, UsingShadowDecl now has a ConstructorUsingShadowDecl derived class that tracks the requisite additional information. We create shadow constructors (not found by name lookup) in the derived class to model the actual initialization, and have a new expression node, CXXInheritedCtorInitExpr, to model the initialization of a base class from such a constructor. (This initialization is special because it performs real perfect forwarding of arguments.) In cases where argument forwarding is not possible (for inalloca calls, variadic calls, and calls with callee parameter cleanup), the shadow inheriting constructor is not emitted and instead we directly emit the initialization code into the caller of the inherited constructor. Note that this new model is not perfectly compatible with the old model in some corner cases. In particular: * if B inherits a private constructor from A, and C uses that constructor to construct a B, then we previously required that A befriends B and B befriends C, but the new rules require A to befriend C directly, and * if a derived class has its own constructors (and so its implicit default constructor is suppressed), it may still inherit a default constructor from a base class llvm-svn: 274049
* Use more ArrayRefsDavid Majnemer2016-06-241-1/+1
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Implement p0292r2 (constexpr if), a likely C++1z feature.Richard Smith2016-06-231-5/+7
| | | | llvm-svn: 273602
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-221-2/+8
| | | | | | | | | | | | | | | | Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
* [OpenCL] Use function metadata to represent kernel attributesYaxun Liu2016-06-221-30/+16
| | | | | | | | This patch uses function metadata to represent reqd_work_group_size, work_group_size_hint and vector_type_hint kernel attributes and kernel argument info. Differential Revision: http://reviews.llvm.org/D20979 llvm-svn: 273425
* [DebugInfo] Add calling conventions to DISubroutineTypeReid Kleckner2016-06-081-8/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: This should have been a very simple change, but it was greatly complicated by the construction of new Decls during IR generation. In particular, we reconstruct the AST function type in order to get the implicit 'this' parameter into C++ method types. We also have to worry about FunctionDecls whose types are not FunctionTypes because CGBlocks.cpp constructs some dummy FunctionDecls with 'void' type. Depends on D21114 Reviewers: aprantl, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21141 llvm-svn: 272198
* [OPENMP 4.0] Codegen for 'declare simd' directive.Alexey Bataev2016-05-061-0/+2
| | | | | | | | | OpenMP 4.0 adds support for elemental functions using declarative directive '#pragma omp declare simd'. Patch adds mangling for simd functions in accordance with https://sourceware.org/glibc/wiki/libmvec?action=AttachFile&do=view&target=VectorABI.txt llvm-svn: 268721
* Debug info: Apply an artificial debug location to __cyg_profile_func.* calls.Adrian Prantl2016-04-281-0/+1
| | | | | | | | | The LLVM Verifier expects all inlinable calls in debuggable functions to have a location. rdar://problem/25818489 llvm-svn: 267904
* reduce indentation; NFCISanjay Patel2016-04-191-9/+6
| | | | llvm-svn: 266787
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-081-3/+2
| | | | | | | | | | | 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. llvm-svn: 265806
* Adapt to LLVM API changeSanjoy Das2016-04-081-1/+1
| | | | | | Replace mayBeOverridden with isInterposable llvm-svn: 265767
* Basic: move CodeGenOptions from FrontendSaleem Abdulrasool2016-04-071-2/+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. llvm-svn: 265702
* Add -fno-jump-tables and-fjump-tables flagsNirav Dave2016-04-051-0/+4
| | | | | | | | | | | | | Add no-jump-tables flag to disable use of jump tables when lowering switch statements Reviewers: echristo, hans Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18407 llvm-svn: 265425
* [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)Faisal Vali2016-03-211-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement lambda capture of *this by copy. For e.g.: struct A { int d = 10; auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; } }; auto L = A{}.foo(); // A{}'s lifetime is gone. // Below is still ok, because *this was captured by value. assert(L(10) == 20); assert(L(100) == 120); If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined. Implementation Strategy: - amend the parser to accept *this in the lambda introducer - add a new king of capture LCK_StarThis - teach Sema::CheckCXXThisCapture to handle by copy captures of the enclosing object (i.e. *this) - when CheckCXXThisCapture does capture by copy, the corresponding initializer expression for the closure's data member direct-initializes it thus making a copy of '*this'. - in codegen, when assigning to CXXThisValue, if *this was captured by copy, make sure it points to the corresponding field member, and not, unlike when captured by reference, what the field member points to. - mark feature as implemented in svn Much gratitude to Richard Smith for his carefully illuminating reviews! llvm-svn: 263921
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-131-17/+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> llvm-svn: 263394
* Temporarily revert these patches:Eric Christopher2016-03-121-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 60d9845f6a037122d9be9a6d92d4de617ef45b04 Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 18:48:02 2016 +0000 Fix clang crash: when CodeGenAction is initialized without a context, use the member and not the parameter From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263273 91177308-0d34-0410-b5e6-96231b3b80d8 commit af7ce3bf04a75ad5124b457b805df26006bd215b Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 17:32:58 2016 +0000 Fix build: use -> with pointers and not . Silly typo. From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263267 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0eea119192814954e7368c77d0dc5a9eeec1fbb Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 17:15:44 2016 +0000 Remove compile time PreserveName switch based on NDEBUG Summary: Following r263086, we are now relying on a flag on the Context to discard Value names in release builds. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18024 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263257 91177308-0d34-0410-b5e6-96231b3b80d8 until we can fix the Release builds. This reverts commits 263257, 263267, 263273 llvm-svn: 263320
* Remove compile time PreserveName switch based on NDEBUGMehdi Amini2016-03-111-17/+3
| | | | | | | | | | | | | | | Summary: Following r263086, we are now relying on a flag on the Context to discard Value names in release builds. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18024 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263257
* [MSVC Compat] Correctly handle finallys nested within finallysDavid Majnemer2016-03-011-0/+3
| | | | | | | | | We'd lose track of the parent CodeGenFunction, leading us to get confused with regard to which function a nested finally belonged to. Differential Revision: http://reviews.llvm.org/D17752 llvm-svn: 262379
* [OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttrXiuli Pan2016-02-261-4/+3
| | | | | | | | | | | | | | | Summary: OpenCL access qualifiers are now not only used for image types, refine it to avoid misleading, Add semacheck for OpenCL access qualifier as well as test caees. Reviewers: pekka.jaaskelainen, Anastasia, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D16040 llvm-svn: 261961
* [PGO] cc1 option name change for profile instrumentationRong Xu2016-02-041-1/+1
| | | | | | | | | | | | This patch changes cc1 option -fprofile-instr-generate to an enum option -fprofile-instrument={clang|none}. It also changes cc1 options -fprofile-instr-generate= to -fprofile-instrument-path=. The driver level option -fprofile-instr-generate and -fprofile-instr-generate= remain intact. This change will pave the way to integrate new PGO instrumentation in IR level. Review: http://reviews.llvm.org/D16730 llvm-svn: 259811
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-021-1/+1
| | | | | | from Driver to Frontend. llvm-svn: 259489
* Introduce -fsanitize-stats flag.Peter Collingbourne2016-01-161-0/+9
| | | | | | | | | 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 llvm-svn: 257971
* function names start with a lower case letter ; NFCSanjay Patel2016-01-121-1/+1
| | | | llvm-svn: 257497
* [OpenCL] Pipe type supportXiuli Pan2016-01-091-5/+24
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 llvm-svn: 257254
* [PGO] Instrument only base constructors and destructors.Serge Pavlov2015-12-061-2/+1
| | | | | | | | | | | | | | | | Constructors and destructors may be represented by several functions in IR. Only base structors correspond to source code, others are small pieces of code and eventually call the base variant. In this case instrumentation of non-base structors has little sense, this fix remove it. Now profile data of a declaration corresponds to exactly one function in IR, it agrees with the current logic of the profile data loading. This change fixes PR24996. Differential Revision: http://reviews.llvm.org/D15158 llvm-svn: 254876
* Add the `pass_object_size` attribute to clang.George Burgess IV2015-12-021-1/+12
| | | | | | | | | | | | | `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring inlining to happen everywhere. A link to the design doc for this attribute is available at the Differential review link below. Differential Revision: http://reviews.llvm.org/D13263 llvm-svn: 254554
* When producing error messages for always_inline functions with theEric Christopher2015-11-161-2/+5
| | | | | | | | | | target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
* Add support for the always_inline + target feature diagnostic to printEric Christopher2015-11-141-6/+11
| | | | | | | out the first missing target feature that's required and reword the diagnostic accordingly. llvm-svn: 253121
* [C++] Add the "norecurse" attribute to main() if in C++ modeJames Molloy2015-11-121-0/+8
| | | | | | The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit. llvm-svn: 252902
* Refactor out some common code from r252834David Blaikie2015-11-121-39/+26
| | | | llvm-svn: 252840
OpenPOWER on IntegriCloud