summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [ASan] Hoist blacklisting globals from init-order checking to Clang.Alexey Samsonov2014-05-291-6/+5
| | | | | | | | | Clang knows about the sanitizer blacklist and it makes no sense to add global to the list of llvm.asan.dynamically_initialized_globals if it will be blacklisted in the instrumentation pass anyway. Instead, we should do as much blacklisting as possible (if not all) in the frontend. llvm-svn: 209789
* Reverting 209503 - Breaks asan blacklistsWarren Hunt2014-05-281-4/+1
| | | | | | | | I opened a discussion on cfe-commits. Ideally we've got a few things that need to happen. CompilerRT should probably have blacklists tests. Asan should probably not depend on that specific field. llvm-svn: 209766
* Debug Info: Fix the source range for IfStmt's ConditionScope.Adrian Prantl2014-05-281-1/+1
| | | | | | | | | | Since the continuation block of the if statement is emitted within the condition scope this had the undesirable effect of creating a line table entry at the end of the then or else statement, a line that may have never been executed. PR19864 / rdar://problem/17052973 llvm-svn: 209764
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-0/+6
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* Don't dllimport/export destructor variants implemented by thunks.Hans Wennborg2014-05-282-16/+18
| | | | | | | | | | | | MSVC doesn't export these functions, so trying to import them doesnt' work. Also, don't let any dll attributes on the CXXDestructorDecl influence the thunk's linkage -- they should always be linkonce_odr. This takes care of the FIXME's for this in Nico's tests. Differential Revision: http://reviews.llvm.org/D3930 llvm-svn: 209706
* Revert small change to EmitDeclRefLValueRenato Golin2014-05-271-9/+8
| | | | | | | That small change, although it looked harmless, it made emitting the LValue on the PHI node without the proper cast. Reverting it fixes PR19841. llvm-svn: 209663
* Fix some misplaced spaces around 'override'Hans Wennborg2014-05-241-1/+1
| | | | llvm-svn: 209588
* AArch64/ARM64: rename ARM64 components to AArch64Tim Northover2014-05-244-474/+475
| | | | | | This keeps Clang consistent with backend naming conventions. llvm-svn: 209579
* AArch64/ARM64: update Clang after AArch64 removal.Tim Northover2014-05-243-1526/+4
| | | | | | | | | | | A few (mostly CodeGen) parts of Clang were tightly coupled to the AArch64 backend. Now that it's gone, they will not even compile. I've also deduplicated RUN lines in many of the AArch64 tests. This might improve "make check-all" time noticably: some of those NEON tests were monsters. llvm-svn: 209578
* Use comdats to avoid double initialization of weak dataReid Kleckner2014-05-234-23/+45
| | | | | | | | | | | | | | | | | Initializers of global data that can appear multiple TUs (static data members of class templates or __declspec(selectany) data) are now in a comdat group keyed on the global variable being initialized. On non-Windows platforms, this is a code size and startup time optimization. On Windows, this is necessary for ABI compatibility with MSVC. Fixes PR16959. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3811 llvm-svn: 209555
* Emit used/dllexport inline method definitions in nested classes (PR19743, ↵Hans Wennborg2014-05-232-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [MS-ABI] Silence warning from r209523Warren Hunt2014-05-231-1/+1
| | | | | | no functional change. llvm-svn: 209525
* [MS-ABI] Implements MS-compatible RTTIWarren Hunt2014-05-236-41/+504
| | | | | | | | | | | | | Enables the emission of MS-compatible RTTI data structures for use with typeid, dynamic_cast and exceptions. Does not implement dynamic_cast or exceptions. As an artiface, typeid works in some cases but proper support an testing will coming in a subsequent patch. majnemer has fuzzed the results. Test cases included. Differential Revision: http://reviews.llvm.org/D3833 llvm-svn: 209523
* Fix '-main-file-name <name>' so that it is used for the ModuleID.Robert Lytton2014-05-231-1/+4
| | | | | | | | | Summary: Previously, you could not specify the original file name when passing a preprocessed file into the compiler Now you can use 'clang -Xclang -main-file-name -Xclang <original file name> ...' Or 'clang -cc1 -main-file-name <original file name> ...' llvm-svn: 209503
* Don't set unnamed_addr in CreateRuntimeVariable.Rafael Espindola2014-05-222-9/+3
| | | | | | | | | | | | | This was fairly broken. For example, @__dso_handle would or would not get an unnamed_addr depending on how many global destructors were used in a translation unit. The consensus was that not every runtime variable is unnamed_addr and that __dso_handle handle should not be, so just don't add unnamed_addr in CreateRuntimeVariable. llvm-svn: 209484
* This patch adds a helper class (CGLoopInfo) for marking memory instructions ↵Alexander Musman2014-05-228-4/+363
| | | | | | | | | | with llvm.mem.parallel_loop_access metadata. It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses). Differential revision: http://reviews.llvm.org/D3644 llvm-svn: 209411
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-2146-854/+895
| | | | llvm-svn: 209272
* Update for paired llvm commit with AsmVerbose.Eric Christopher2014-05-211-6/+1
| | | | llvm-svn: 209261
* Update for llvm change to avoid having global flag setting in TargetMachine.Eric Christopher2014-05-201-3/+2
| | | | llvm-svn: 209239
* Implement the flatten attribute.Peter Collingbourne2014-05-201-0/+6
| | | | | | | | | | This is a GNU attribute that causes calls within the attributed function to be inlined where possible. It is implemented by giving such calls the alwaysinline attribute. Differential Revision: http://reviews.llvm.org/D3816 llvm-svn: 209217
* Clean up language and grammar.Eric Christopher2014-05-201-1/+1
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209215
* XCore target: sort typestring enum fields alphabeticallyRobert Lytton2014-05-201-16/+23
| | | | llvm-svn: 209196
* Demote the "Debug Info Version" module flag to llvm::Module::WarningAdrian Prantl2014-05-191-6/+4
| | | | | | | | | behavior on mismatch. The AutoUpgrader will drop incompatible debug info any way and also emit a warning diagnostic for it. rdar://problem/16926122 llvm-svn: 209182
* Using SmallString and correct addr varRenato Golin2014-05-191-3/+5
| | | | llvm-svn: 209180
* Fix usage of string when StringRef was neededRenato Golin2014-05-191-1/+3
| | | | | | | | | Also adding a variable to the test, so release bots match %1. This should also calm the gdb buildbot. . llvm-svn: 209171
* Implement the no_split_stack attribute.Peter Collingbourne2014-05-191-1/+2
| | | | | | | | | This is a GNU attribute that allows split stacks to be turned off on a per-function basis. Differential Revision: http://reviews.llvm.org/D3817 llvm-svn: 209167
* Non-allocatable Global Named RegisterRenato Golin2014-05-193-3/+77
| | | | | | | | | | | | | This patch implements global named registers in Clang, lowering to the just created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue had to be created (Register), which just adds support to carry the metadata node containing the name of the register. Two new methods to emit loads and stores interoperate with another to emit the named metadata node. No guarantees are being made and only non-allocatable global variable named registers are being supported. Local named register support is unchanged. llvm-svn: 209149
* ARM: PCS non-compliance when struct is padded to avoid register/stack split, ↵Oliver Stannard2014-05-191-4/+8
| | | | | | | | | | and requires internal padding When we were padding a struct to avoid splitting it between registers and the stack, we were throwing away the type which the argument should be coerced to. llvm-svn: 209122
* Update for llvm api change.Rafael Espindola2014-05-175-12/+12
| | | | llvm-svn: 209077
* Update for llvm api change.Rafael Espindola2014-05-175-23/+19
| | | | llvm-svn: 209074
* CodeGen: remove MinGW and Cygwin legacy entriesSaleem Abdulrasool2014-05-171-2/+0
| | | | | | | | | These are now treated as environments. Remove references to these enumeration values in order to clean up the unused enumeration entries in LLVM. The target normalisation prior to tool invocation should ensure that the old values continue to function properly. llvm-svn: 209068
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-163-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Use getAliasee instead of getAliasedGlobal.Rafael Espindola2014-05-161-2/+2
| | | | | | No functionality change. llvm-svn: 209038
* Missed a ! in the if statement when these were being set and the optionsEric Christopher2014-05-161-1/+1
| | | | | | | | | are inverted in clang and llvm. I'll attempt to get a testcase for this that doesn't involve compiling to .s, but it's unlikely. llvm-svn: 209017
* Update for llvm api change.Rafael Espindola2014-05-163-42/+46
| | | | | | | | | | Now that llvm cannot represent alias cycles, we have to diagnose erros just before trying to close the cycle. This degrades the errors a bit. The real solution is what it was before: if we want to provide good errors for these cases, we have to be able to find a clang level decl given a mangled name and produce the error from Sema. llvm-svn: 209008
* Rename SourceManager::createFileIDForMemBuffer()Alp Toker2014-05-161-1/+1
| | | | | | | | It makes more sense to just overload createFileID(). Gardening only. llvm-svn: 209002
* Update for llvm API change.Rafael Espindola2014-05-165-16/+17
| | | | llvm-svn: 208984
* InstrProf: Set profile data to visibility hiddenDuncan P. N. Exon Smith2014-05-161-0/+9
| | | | | | | | | | | | | Shared objects are fairly broken for InstrProf right now -- a follow-up commit in compiler-rt will fix the rest of this. The main problem here is that at link time, profile data symbols in the shared object might get used instead of symbols from the main executable, creating invalid profile data sections. <rdar://problem/16918688> llvm-svn: 208939
* MS ABI: Use musttail for thunk IR generationReid Kleckner2014-05-152-3/+26
| | | | | | | | | | | This allows us to perfectly forward non-trivial arguments that use inalloca. We still can't forward non-trivial arguments through thunks when we have a covariant return type with a non-trivial adjustment. This would require emitting an extra copy, which is non-conforming anyway. llvm-svn: 208927
* Allow dllimport/dllexport on inline functions and adjust the linkage.Hans Wennborg2014-05-151-12/+3
| | | | | | | | This is a step towards handling these attributes on classes (PR11170). Differential Revision: http://reviews.llvm.org/D3772 llvm-svn: 208925
* Revert Itanium parts of "Don't copy objects with trivial, deleted copy ctors"Reid Kleckner2014-05-152-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | This undoes half of r208786. It had problems with lazily declared special members in cases like this: struct A { A(); A &operator=(A &&o); void *p; }; void foo(A); void bar() { foo({}); } In this case, the copy and move constructors are implicitly deleted. However, Clang doesn't eagerly declare the copy ctor in the AST, so we pass the struct in registers. Furthermore, GCC passes this in registers even though this class should be uncopyable. Revert this for now until the dust settles. llvm-svn: 208836
* Fill in the options in the MCOptions struct directly like the otherEric Christopher2014-05-151-9/+5
| | | | | | options. llvm-svn: 208834
* Rename CodeGenModule::getLLVMLinkageforDeclarator -> getLLVMLinkageForDeclaratorHans Wennborg2014-05-142-4/+4
| | | | | | No functionality change. llvm-svn: 208808
* Don't copy objects with trivial, deleted copy ctorsReid Kleckner2014-05-144-10/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects both the Itanium and Microsoft C++ ABIs. This is in anticipation of a change to the Itanium C++ ABI, and should match GCC's current behavior. The new text will likely be: """ Pass an object of class type by value if every copy constructor and move constructor is deleted or trivial and at least one of them is not deleted, and the destructor is trivial. """ http://sourcerytools.com/pipermail/cxx-abi-dev/2014-May/002728.html On x86 Windows, we can mostly use the same logic, where we use inalloca instead of passing by address. However, on Win64, there are register parameters, and we have to do what MSVC does. MSVC ignores the presence of non-trivial move constructors and only considers the presence of non-trivial or deleted copy constructors. If a non-trivial or deleted copy ctor is present, it passes the argument indirectly. This change fixes bugs and makes us more ABI compatible with both GCC and MSVC. Fixes PR19668. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3660 llvm-svn: 208786
* [ARM64]Fix the bug right shift uint64_t by 64 generates incorrect result.Hao Liu2014-05-141-13/+16
| | | | llvm-svn: 208761
* DebugInfo: Avoid creating DILexicalScopeFiles when the filename in the ↵David Blaikie2014-05-141-7/+11
| | | | | | | | | | | | | | | | | | | current scope has not changed. This looks like the right way for this check to work, but there is another semi-obvious bug, I would think: why is CurLoc not zero'd out between functions? The possibility for it to bleed between them seems problematic. (& indeed I caused tests to fail when I fixed this a different way, by setting CurLoc to SourceLocation() and the end of EmitFunctionEnd... ) The changes to debug-info-blocks.m are due to a mismatch between the source manager's file naming and CGDebugInfo's default handling when no -main-file-name is specified. This actually reveals somewhat of a bug in the debug info when using source files from standard in, too. See the comment in CGDebugInfo::CreateCompileUnit for more details. llvm-svn: 208742
* Push record return type classification into CGCXXABIReid Kleckner2014-05-134-113/+84
| | | | | | | | | | | | In the Microsoft C++ ABI, instance methods always return records indirectly via the second hidden parameter. This was implemented in X86_32ABIInfo, but not WinX86_64ABIInfo. Rather than exposing a handful of boolean methods in the CGCXXABI interface, we can expose a single method that applies C++ ABI return value classification rules. llvm-svn: 208733
* Update for llvm API change.Rafael Espindola2014-05-132-6/+5
| | | | llvm-svn: 208717
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-1/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Add FIXME describing the limitation of using column info to disambiguate ↵David Blaikie2014-05-101-0/+8
| | | | | | | | | | | | | | | | | | | | inlining. Also tidy up, simplify, and extend the test coverage to demonstrate the limitations. This test should now fail if the bugs are fixed (& hopefully whoever ends up in this situation sees the FIXMEs and realizes that the test needs to be updated to positively test their change that has fixed some or all of these issues). I do wonder whether I could demonstrate breakage without a macro here, but any way I slice it I can't think of a way to get two calls to the same function on the same line/column in non-macro C++ - implicit conversions happen at the same location as an explicit function, but you'd never get an implicit conversion on the result of an explicit call to the same implicit conversion operator (since the value is already converted to the desired result)... llvm-svn: 208468
OpenPOWER on IntegriCloud