summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-073-21/+14
| | | | | | 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
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-073-16/+10
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Remove dead return and simplify code.Ted Kremenek2014-03-071-3/+1
| | | | llvm-svn: 203266
* Renaming the chains() ranged iterator to chain() per suggestion by Richard ↵Aaron Ballman2014-03-071-1/+1
| | | | | | Smith. llvm-svn: 203262
* [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() ↵Aaron Ballman2014-03-071-4/+2
| | | | | | with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203261
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-074-15/+8
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* [C++11] Replacing BlockDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-072-7/+4
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203250
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-5/+3
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-071-3/+3
| | | | | | No functionality change. llvm-svn: 203241
* [C++11] Replacing iterators redecls_begin() and redecls_end() with ↵Aaron Ballman2014-03-062-5/+2
| | | | | | iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely. llvm-svn: 203179
* Use llvm.compiler.used instead of llvm.used for objc symbols.Rafael Espindola2014-03-064-39/+52
| | | | | | | | | | | | | LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the ones that the clang's objc codegen is producing. The net result, is that it is equivalent to llvm.compiler.used. The need for putting the private symbol in llvm.compiler.used should be clear (the objc runtime uses them). The reason for also putting the weak symbols in it is for LTO: ld64 will not ask us to preserve the it. llvm-svn: 203172
* PGO: Add support for Objective-C blocks.Bob Wilson2014-03-062-1/+22
| | | | llvm-svn: 203157
* Revert "Use private linkage for remaining GlobalVariables with private names."Rafael Espindola2014-03-061-11/+11
| | | | | | | | This reverts commit r203059. Revert while we discuss what does it mean to be private and weak. llvm-svn: 203141
* PGO: add instrumentation for Objective-C methods.Bob Wilson2014-03-062-2/+30
| | | | llvm-svn: 203085
* Remove 'break' dominated by 'return' in 'EmitBuiltinExpr'.Ted Kremenek2014-03-061-1/+0
| | | | llvm-svn: 203080
* PGO: Use the main file name to help distinguish functions with local linkage.Bob Wilson2014-03-063-23/+56
| | | | | | | | | | | | In addition, for all functions, use the name from the llvm::Function to identify the function in the profile data. Compute that "function name", including the file name for local functions, once when assigning the PGO counters and store it in the CodeGenPGO class. Move the code to add InlineHint and Cold attributes out of StartFunction(), because the "function name" string isn't available at that point. llvm-svn: 203075
* PGO: Rename variables to avoid referring to the "MangledName" of a function.Bob Wilson2014-03-062-19/+18
| | | | | | | | | | | | For C++ functions, we will continue to use the mangled name to identify functions in the PGO profile data, but this name is confusing for things like Objective-C methods. For functions with local linkage, we're also going to include the file name to help distinguish those functions, so this changes to use more generic variable names. No functional changes. llvm-svn: 203074
* Refactor PGO code in preparation for handling non-C/C++ code.Bob Wilson2014-03-063-12/+11
| | | | | | | | | | | Move the PGO.assignRegionCounters() call out of StartFunction, because that function is called from many places where it does not make sense to do PGO instrumentation (e.g., compiler-generated helper functions). Change several functions to take a StringRef argument for the unique name associated with a function, so that the name can be set differently for things like Objective-C methods and block literals. llvm-svn: 203073
* PGO: don't emit counter increment if no counters have been allocated.Bob Wilson2014-03-061-1/+1
| | | | | | | | I hit this while debugging another issue where my sources were in an inconsistent state, so I don't have a testcase. Regardless, this check is simpler and more direct than checking if the option is enabled. llvm-svn: 203072
* [Layering] Update include of Linker.h to match its move to a LinkerChandler Carruth2014-03-061-1/+1
| | | | | | subdirectory in LLVM r203065. llvm-svn: 203067
* Use private linkage for remaining GlobalVariables with private names.Rafael Espindola2014-03-061-11/+11
| | | | | | | | | | | | | | | | | | | | | | This patch changes the remaining GlobalVariables using "\01L" and "\01l" prefixes to use private linkage. What is strange about them is that they currently use WeakAnyLinkage. There is no comment stating why and that is really odd since the symbols are completely hidden, so it doesn't make sense for them to be weak. Clang revisions like r63329, r63408, r63770, r65761 set the linkage to weak, but don't say why. I suspect they were just copying llvm-gcc. In llvm-gcc I found r58599 and r56322 that set DECL_WEAK, but they were just syncing from the apple gcc. I am not exactly sure what that means, since the last commit to svn://gcc.gnu.org/svn/gcc/branches/apple was in 2006, 2 years earlier. In summary, I have no idea why weak linkage was being used :-( To quote John McCall, "Let’s try without it and see" :-) llvm-svn: 203059
* Construct GlobalValues with the correct linkage instead of using setLinkage.Rafael Espindola2014-03-061-8/+7
| | | | llvm-svn: 203052
* [Layering] Update include of DebugInfo.h which moved to the IR libraryChandler Carruth2014-03-061-1/+1
| | | | | | in LLVM r203046. llvm-svn: 203047
* [Layering] Update include for the move of DIBuilder.h to the IR libraryChandler Carruth2014-03-061-1/+1
| | | | | | in LLVM r203038. llvm-svn: 203039
* Don't produce an alias between destructors with different calling conventions.Rafael Espindola2014-03-051-0/+6
| | | | | | Fixes pr19007. llvm-svn: 203007
* [-cxx-abi microsoft] Implement local manglings accuratelyDavid Majnemer2014-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MSVC ABI appears to mangle the lexical scope into the names of statics. Specifically, a counter is incremented whenever a scope is entered where things can be declared in such a way that an ambiguity can arise. For example, a class scope inside of a class scope doesn't do anything interesting because the nested class cannot collide with another nested class. There are problems with this scheme: - It is unreliable. The counter is only incremented when a previously never encountered scope is entered. There are cases where this will cause ambiguity amongst declarations that have the same name where one was introduced in a deep scope while the other was introduced right after in the previous lexical scope. - It is wasteful. Statements like: {{{{{{{ static int foo = a; }}}}}}} will make the mangling of "foo" larger than it need be because the scope counter has been incremented many times. Because of these problems, and practical implementation concerns. We choose not to implement this scheme if the local static or local type isn't visible. The mangling of these declarations will look very similar but the numbering will make far more sense, this scheme is lifted from the Itanium ABI implementation. Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2953 llvm-svn: 202951
* Objective-C. Return 0 as class of methods in protocols.Fariborz Jahanian2014-03-041-2/+1
| | | | | | | This simplifies my last patch a bit. No change in functionality. llvm-svn: 202906
* DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring ↵David Blaikie2014-03-041-2/+7
| | | | | | types aren't needlessly built during -gmlt llvm-svn: 202900
* Fix unconditional dereference of a WeakVH in CGDebugInfo TypeCacheReid Kleckner2014-03-041-1/+2
| | | | | | | | | | | | This fails an "isa<> used with null pointer" assert during a clang-cl self-host on Windows. This was caused by r202769, and I'm currently reducing a test case. Reviewers: dblaikie Differential Revision: http://llvm-reviews.chandlerc.com/D2944 llvm-svn: 202888
* Objective-C IRGen. Fix up the hueristics for determiningFariborz Jahanian2014-03-041-8/+10
| | | | | | | | if an ivar offset load is invariant iff inside an instance method and ivar belongs to instance method's class and one of its super class. // rdar://16095748 llvm-svn: 202872
* [Modules] Update to reflect the move of CFG.h to the IR library in LLVMChandler Carruth2014-03-041-1/+1
| | | | | | r202827. llvm-svn: 202828
* [Modules] Update to reflect ValueHandle moving to the IR library in LLVMChandler Carruth2014-03-043-3/+3
| | | | | | r202821. llvm-svn: 202822
* [Modules] Update to reflect the move of CallSite into the IR library inChandler Carruth2014-03-0411-11/+11
| | | | | | LLVM r202816. llvm-svn: 202817
* DebugInfo: Improvements/corrections to conservative emission of types in ↵David Blaikie2014-03-041-1/+2
| | | | | | | | | explicit template instantiation declarations * detect out of line definitions correctly * detect member function explicit specializations correctly llvm-svn: 202779
* DebugInfo: Emit only the declaration of a class template that has an ↵David Blaikie2014-03-033-19/+62
| | | | | | | | | | | | | | | | | | | | | | | explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition) We should only have this optimization fire when the explicit instantiation definition would cause at least one member function to be emitted, thus ensuring that even a compiler not performing this optimization would still emit the full type information elsewhere. But we should also pessimize output still by always emitting the definition when the explicit instantiation definition appears so that at some point in the future we can depend on that information even when no code had to be emitted in that TU. (this shouldn't happen very often, since people mostly use explicit spec decl/defs to reduce code size - but perhaps one day they could use it to explicitly reduce debug info size too) This was worth about 2% for Clang and LLVM - so not a huge win, but a win. It looks really great for simple STL programs (include <string> and just declare a string - 14k -> 1.4k of .dwo) llvm-svn: 202769
* Objective-C. Fixes a regression when figuring out linkageFariborz Jahanian2014-03-031-1/+2
| | | | | | | for metadata symbols for forward referenced protocols which are never defined. // rdar://16203115 llvm-svn: 202761
* [C++11] Simplify compare operators with std::tie.Benjamin Kramer2014-03-031-4/+2
| | | | | | No functionality change. llvm-svn: 202755
* Schedule discriminator pass.Diego Novillo2014-03-031-0/+8
| | | | | | | This needs to modify a line table test to account for the new lexical block created to hold the new discriminator value. llvm-svn: 202754
* Update call DIBuilder::createLexicalBlock.Diego Novillo2014-03-031-1/+2
| | | | | | Create lexical blocks with discriminator value 0 by default. llvm-svn: 202737
* correct consitency of XCore capsRobert Lytton2014-03-031-4/+4
| | | | llvm-svn: 202711
* [C++11] Add #include's for OwningPtr.Ahmed Charles2014-03-031-0/+1
| | | | | | Allows removing #include's in LLVM while switching to std::unique_ptr. llvm-svn: 202677
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-028-15/+16
| | | | llvm-svn: 202639
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202635
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-023-4/+4
| | | | llvm-svn: 202625
* Fixed an assertion failure related to bitfield lowering.Warren Hunt2014-03-011-2/+5
| | | | | | | | | When lowering a bitfield, CGRecordLowering would assign the wrong storage type to a bitfield in some cases and trigger an assertion. In these cases the layout was still correct, just the bitfield info was wrong. llvm-svn: 202562
* Add 'remark' diagnostic type in 'clang'Tobias Grosser2014-02-281-1/+22
| | | | | | | | | | | | | | | | | | | | | | | A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic. A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized. This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks. This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling. llvm-svn: 202475
* Remove an assertion that no longer holds. <rdar://problem/16135814>Bob Wilson2014-02-271-1/+0
| | | | | | | | In r201528, I changed the PGO instrumentation counter for a "do" loop to not include the fall-through count. That fall-through count is included later, b it means that this assertion may fail for "do" loops. llvm-svn: 202437
* Fix -Wunused-function in Release build.Rui Ueyama2014-02-271-0/+1
| | | | llvm-svn: 202429
* MS ABI: Fix vftable mangling by using the vbtable name algorithmReid Kleckner2014-02-271-27/+25
| | | | | | | | | | | | | | | | | | Summary: This merges VFPtrInfo and VBTableInfo into VPtrInfo, since they hold almost the same information. With that change, the vbtable mangling code can easily be applied to vftable data and we magically get the correct, unambiguous vftable names. Fixes PR17748. Reviewers: timurrrr, majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2893 llvm-svn: 202425
* Use private linkage for globals we already name with \01L and \01l.Rafael Espindola2014-02-271-17/+18
| | | | | | | | | | | | In llvm the only semantic difference between internal and private is that llvm tries to hide private globals my mangling them with a private prefix. Since the globals changed by this patch already had the magic don't mangle marker, there should be no change in the generated assembly. A followup patch should then be able to drop the \01L and \01l prefixes and let llvm mangle as appropriate. llvm-svn: 202419
OpenPOWER on IntegriCloud