summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Be more specific about return types of some methods.Alexey Samsonov2014-07-102-10/+12
| | | | | | | This would allow to call addCompilerUsedGlobal on some Clang-generated globals. llvm-svn: 212767
* PR20256: don't accidentally instantiate non-dependent default-initialization asRichard Smith2014-07-102-2/+10
| | | | | | value-initialization. llvm-svn: 212764
* Fix the dtor location issues in PR20038 harder.David Blaikie2014-07-103-17/+30
| | | | | | | | | | | | | Originally committed in r211722, this fixed one case of dtor calls being emitted without locations (this causes problems for debug info if the call is then inlined), this caught only some of the cases. Instead of trying to re-enable the location before the cleanup, simply re-enable the location immediately after the unconditional branches in question using a scoped device to ensure the no-location state doesn't leak out arbitrarily. llvm-svn: 212761
* Remove use of uniform initialization ({}) introduced in r212725 since this ↵David Blaikie2014-07-102-2/+2
| | | | | | isn't supported in MSVC. llvm-svn: 212754
* Avoid definining more GCC specific predefined macros in clang-clEhsan Akhgari2014-07-101-29/+31
| | | | | | | | | | Reviewers: hansw, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4419 llvm-svn: 212753
* [PowerPC] ABI support for aligned by-value aggregatesUlrich Weigand2014-07-101-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for respecting the ABI and type alignment of aggregates passed by value. Currently, all aggregates are aligned at 8 bytes in the parameter save area. This is incorrect for two reasons: - Aggregates that need alignment of 16 bytes or more should be aligned at 16 bytes in the parameter save area. This is implemented by using an appropriate "byval align" attribute in the IR. - Aggregates that need alignment beyond 16 bytes need to be dynamically realigned by the caller. This is implemented by setting the Realign flag of the ABIArgInfo::getIndirect call. In addition, when expanding a va_arg call accessing a type that is aligned at 16 bytes in the argument save area (either one of the aggregate types as above, or a vector type which is already aligned at 16 bytes), code needs to align the va_list pointer accordingly. Reviewed by Hal Finkel. llvm-svn: 212743
* Provide -verify support to match "any" line for diagnostics in included files.Andy Gibbs2014-07-101-15/+30
| | | | | | | | Allow diagnostic checks that originate in included files to be matched without necessarily determining the line number that the diagnostic occurs on. The new syntax replaces the line number with '*'. This extension is limited to diagnostics in included files and may be used where the include file is not part of the test-suite itself. Expected uses are for diagnostics originating in system headers, or for users who use -verify in testing 3rd-party library code where the location of diagnostics in header files may change from revision to revision and their precise location is not important to the success of the test-case. llvm-svn: 212735
* [PowerPC] ABI support for non-Altivec vector typesUlrich Weigand2014-07-101-1/+26
| | | | | | | | | | | | | | | | | | | | | This patch adds support for passing arguments of non-Altivec vector type (i.e. defined via attribute ((vector_size (...)))) on powerpc64-linux. While such types are not mentioned in the formal ABI document, this patch implements a calling convention compatible with GCC: - Vectors of size < 16 bytes are passed in a GPR - Vectors of size > 16 bytes are passed via reference Note that vector types with a number of elements that is not a power of 2 are not supported by GCC, so there is no pre-existing ABI to follow. We choose to pass those (of size < 16) as if widened to the next power of two, so they might end up in a vector register or in a GPR. (Sizes > 16 are always passed via reference as well.) Reviewed by Hal Finkel. llvm-svn: 212734
* [analyzer] Check for code testing a variable for 0 after using it as a ↵Jordan Rose2014-07-103-0/+269
| | | | | | | | | | | | | | | | | | | denominator. This new checker, alpha.core.TestAfterDivZero, catches issues like this: int sum = ... int avg = sum / count; // potential division by zero... if (count == 0) { ... } // ...caught here Because the analyzer does not necessarily explore /all/ paths through a program, this check is restricted to only work on zero checks that immediately follow a division operation (/ % /= %=). This could later be expanded to handle checks dominated by a division operation but not necessarily in the same CFG block. Patch by Anders Rönnholm! (with very minor modifications by me) llvm-svn: 212731
* [Codestyle][x32] Cosmetic codestyle fix.Zinovy Nis2014-07-101-6/+6
| | | | llvm-svn: 212728
* [x32] Adding X32 target support to driver, including ↵Zinovy Nis2014-07-103-28/+76
| | | | | | | | | | TargetInfo,DescriptionString, flags, paths lookup, etc. Cover changes with new tests. The author of the patch is Pavel Chupin (@pavel.v.chupin). The changes enable "hello world" on x32 target (x86_64-*-linux-gnux32). s/isX32/IsX32/ also fixed. Differential Revision: http://reviews.llvm.org/D4180 llvm-svn: 212725
* [mips][mips64r6] Add support for mips-img-linux-gnu GCC toolchainsDaniel Sanders2014-07-103-13/+62
| | | | | | | | | | | | | | Summary: * Support the multilib layout used by the mips-img-linux-gnu * Recognize mips{,64}{,el}-img-linux-gnu as being aliases of mips-img-linux-gnu * Use the correct dynamic linker for mips-img-linux-gnu * Make mips32r6/mips64r6 the default CPU for mips-img-linux-gnu Subscribers: mpf Differential Revision: http://reviews.llvm.org/D4436 llvm-svn: 212719
* [mips] Add support for -modd-spreg/-mno-odd-spregDaniel Sanders2014-07-101-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D4432 llvm-svn: 212700
* Add clang headers that fix machine-dependent definitions on FreeBSD 9.2Viktor Kutuzov2014-07-103-0/+218
| | | | | | Differential Revision: http://reviews.llvm.org/D3908 llvm-svn: 212689
* MS ABI: Fix __fastcall methods that return structsReid Kleckner2014-07-101-1/+9
| | | | | | | | | The sret paramater consumes the register after the implicit 'this' parameter, as with other calling conventions. Fixes PR20278, which turned out to be very easy. llvm-svn: 212669
* Cleanup. No functionality change.Richard Smith2014-07-101-2/+2
| | | | llvm-svn: 212667
* [Driver] Expose getARMCPUForMArch() function in the Driver API; NFC.Argyrios Kyrtzidis2014-07-101-3/+8
| | | | llvm-svn: 212666
* Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.Alexey Samsonov2014-07-097-13/+104
| | | | | | | | | | | | | | | | Turn llvm::SpecialCaseList into a simple class that parses text files in a specified format and knows nothing about LLVM IR. Move this class into LLVMSupport library. Implement two users of this class: * DFSanABIList in DFSan instrumentation pass. * SanitizerBlacklist in Clang CodeGen library. The latter will be modified to use actual source-level information from frontend (source file names) instead of unstable LLVM IR things (LLVM Module identifier). Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils. No functionality change. llvm-svn: 212643
* Sema: Allow aliases to have incomplete typeDavid Majnemer2014-07-091-5/+7
| | | | | | | | | | | | gcc supports this behavior and it is pervasively used inside the Linux kernel. Note that both gcc and clang will reject code that attempts to do this in a C++ language mode. This fixes PR17998. llvm-svn: 212631
* Fix 'source-level' hyphenationsAlp Toker2014-07-092-2/+2
| | | | llvm-svn: 212621
* cc1as: consolidate option flags with cc1 and eliminate duplicationAlp Toker2014-07-092-46/+0
| | | | | | | | | | The clang -cc1as options are nearly a strict subset of -cc1. Instead of duplicating the definitions and documentation, let's go ahead and share the definitions in a similar way the current handling of combined driver and frontend flags, eliminating some of the vestigial legacy surrounding the assembler subcommand. llvm-svn: 212620
* [mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 ↵Daniel Sanders2014-07-091-2/+12
| | | | | | | | | | | | correctly on MIPS32r6/MIPS64r6 Summary: This removes the need to pass -mnan=2008 explicitly to be able to compile the test-suite for MIPS32r6/MIPS64r6. Differential Revision: http://reviews.llvm.org/D4433 llvm-svn: 212619
* [mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.Daniel Sanders2014-07-091-0/+2
| | | | | | | | | | | | | | | Summary: While debugging another issue, I noticed that Mips currently specifies that the count leading zero builtins are undefined when the input is zero. The architecture specifications say that the clz and dclz instructions write 32 or 64 respectively when given zero. This doesn't fix any bugs that I'm aware of but it may improve optimisation in some cases. Differential Revision: http://reviews.llvm.org/D4431 llvm-svn: 212618
* clang-format: Fix behavior around pointer-to-member invocations.Daniel Jasper2014-07-092-4/+5
| | | | | | | | | | | | Before: (aaaaaaaaaa->* bbbbbbb)(aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa)); After: (aaaaaaaaaa->*bbbbbbb)( aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa)); llvm-svn: 212617
* ARM: use LLVM's atomicrmw instructions when ldrex/strex are available.Tim Northover2014-07-091-17/+11
| | | | | | | | | | | | | | Having some kind of weird kernel-assisted ABI for these when the native instructions are available appears to be (and should be) the exception; OSs have been gradually opting in for years and the code was getting silly. So let LLVM decide whether it's possible/profitable to inline them by default. Patch by Phoebe Buckheister. llvm-svn: 212598
* clang-format: Add new option to indent wrapped function declarations.Daniel Jasper2014-07-092-2/+8
| | | | | | | | | Though not completely identical, make former IndentFunctionDeclarationAfterType change this flag for backwards compatibility (it is somewhat close in meaning and better the err'ing on an unknown config flag). llvm-svn: 212597
* clang-format: Revamp function declaration/definition indentation.Daniel Jasper2014-07-095-19/+53
| | | | | | | | | | | | | | Key changes: - Correctly (well ...) distinguish function declarations and variable declarations with ()-initialization. - Don't indent when breaking function declarations/definitions after the return type. - Indent variable declarations and typedefs when breaking after the type. This fixes llvm.org/PR17999. llvm-svn: 212591
* Fix typos.Nikola Smiljanic2014-07-092-2/+2
| | | | llvm-svn: 212589
* Simplify warning flag value handling from r206826Alp Toker2014-07-091-1/+1
| | | | | | Also give the field it a more appropriate name and improve the docs. llvm-svn: 212584
* rewrap to 80 cols, no behavior changeNico Weber2014-07-082-6/+7
| | | | llvm-svn: 212578
* rewrap to 80 cols, no behavior changeNico Weber2014-07-081-2/+3
| | | | llvm-svn: 212574
* MS compat: Allow lookup of types from dependent bases in functionsReid Kleckner2014-07-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | If we want to resolve the remaining FIXMEs here, we probably want to extend the main lookup mechanism to perform lookup into dependent bases, but we would have to tread lightly. Adding more name lookup has major impact on compile time. If we did extend the main mechanism, we would add a flag to LookupResult that allows us to find names from dependent base classes where the base is a specialization of a known template. The final LookupResult would still return LookupResult::NotFoundInCurrentInstantiation, but it would have a collection of Decls. If we find a real lookup result, we would clear the flag and the existing lookup results and begin accumulating only real lookup results. We would structure the lookup as a secondary lookup between normal lookup and typo correction for normal compilation, but for MSVC compatibility mode, we would always enable this extra lookup into dependent bases. llvm-svn: 212566
* Remove unnecessary check for NULLAlexey Samsonov2014-07-081-10/+7
| | | | llvm-svn: 212564
* Allow more lookup of types in dependent base classesReid Kleckner2014-07-081-0/+66
| | | | | | | | | | | | | | | | | | | | MSVC appears to perform name lookup into dependent base classes when the dependent base class has a known primary template. This allows them to know whether some unqualified ids are types or not, which allows them to parse more class templates without typename keywords. We can do the same thing when type name lookup fails, and if we find a single type decl in one of our dependent base classes, recover as though the user wrote 'typename MyClass::TypeFromBase'. This allows us to parse some COM smart pointer classes in wrl/client.h from the Windows 8 SDK. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4237 llvm-svn: 212561
* Don't pull in setjmp.h in -ffreestanding compiles.Nico Weber2014-07-081-2/+7
| | | | | | | | Also provide _setjmpex(). r200243 put in _setjmp() and _setjmpex() behind a comment since jmp_buf wasn't available. r200344 added jmp_buf and put in _setjmp(), but missed _setjmpex(). llvm-svn: 212557
* Replace a few // comments with /**/ comments in headers, for consistency.Nico Weber2014-07-082-4/+4
| | | | llvm-svn: 212556
* Sema: Don't allow CVR qualifiers before structorsDavid Majnemer2014-07-082-27/+48
| | | | | | | | | We would silently accept volatile ~S() when the user probably intended to write virtual ~S(). This fixes PR20238. llvm-svn: 212555
* PR20227: materialize a temporary when dynamic_casting a class prvalue to aRichard Smith2014-07-081-1/+9
| | | | | | reference type. llvm-svn: 212551
* Turn some Twine locals into const char * variables.Benjamin Kramer2014-07-081-4/+4
| | | | | | | No functionality change, just stylistic cleanup. Change made by clang-tidy and clang-format. llvm-svn: 212544
* Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie2014-07-084-19/+12
| | | | | | | | | std::unique_ptr Spotted after a memory leak (due to the complexities of manual memory management) was fixed in 212466. llvm-svn: 212541
* Move misplaced x86_32 ABI codeRichard Sandiford2014-07-081-38/+38
| | | | | | | | | | r184166 added an X86_32 function in the middle of the SystemZ code. The SystemZ port had been added only a couple of weeks earlier and the original patch probably predated that. No behavioral change intended. llvm-svn: 212524
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-0813-7/+164
| | | | llvm-svn: 212516
* Headers: conditionalise more declarationsSaleem Abdulrasool2014-07-081-0/+2
| | | | | | | | Protect MMX specific declarations under a __MMX__ guard. This header can be included on non-x86 architectures (e.g. ARM) which do not support the MMX ISA. Use the preprocessor to prevent these declarations from being processed. llvm-svn: 212512
* Headers: mark arm_acle.h with extern "C"Saleem Abdulrasool2014-07-081-0/+8
| | | | | | | | | Although the functions are marked as always_inline, the compiler with which they are used may not honour the extended attributes and emit them as functions. In such a case, indicate that they should have extern "C" linkage and should not be mangled in C++ style if used within C++. llvm-svn: 212511
* MS ABI: "Fix" passing non-POD structs by value to variadic functionsReid Kleckner2014-07-081-20/+25
| | | | | | | | | | Of course, such code is horribly broken and will explode on impact. That said, ATL does it, and we have to support them, at least a little bit. Fixes PR20191. llvm-svn: 212508
* [ASan] Completely remove sanitizer blacklist file from instrumentation pass.Alexey Samsonov2014-07-081-4/+1
| | | | | | | | | | | | | | | | | | | | All blacklisting logic is now moved to the frontend (Clang). If a function (or source file it is in) is blacklisted, it doesn't get sanitize_address attribute and is therefore not instrumented. If a global variable (or source file it is in) is blacklisted, it is reported to be blacklisted by the entry in llvm.asan.globals metadata, and is not modified by the instrumentation. The latter may lead to certain false positives - not all the globals created by Clang are described in llvm.asan.globals metadata (e.g, RTTI descriptors are not), so we may start reporting errors on them even if "module" they appear in is blacklisted. We assume it's fine to take such risk: 1) errors on these globals are rare and usually indicate wild memory access 2) we can lazily add descriptors for these globals into llvm.asan.globals lazily. llvm-svn: 212505
* Rename static function to better describe its purposeAlp Toker2014-07-081-4/+4
| | | | llvm-svn: 212502
* [Sanitizer] Remove brittle cache variable and slightly simplify blacklisting ↵Alexey Samsonov2014-07-075-21/+15
| | | | | | | | | | | | code. Now CodeGenFunction is responsible for looking at sanitizer blacklist (in CodeGenFunction::StartFunction) and turning off instrumentation, if necessary. No functionality change. llvm-svn: 212501
* [Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModuleAlexey Samsonov2014-07-073-19/+19
| | | | | | | | | | | | | | | | Get rid of cached CodeGenModule::SanOpts, which was used to turn off sanitizer codegen options if current LLVM Module is blacklisted, and use plain LangOpts.Sanitize instead. 1) Some codegen decisions (turning TBAA or writable strings on/off) shouldn't depend on the contents of blacklist. 2) llvm.asan.globals should *always* be created, even if the module is blacklisted - soon Clang's CodeGen where we read sanitizer blacklist files, so we should properly report which globals are blacklisted to the backend. llvm-svn: 212499
* ASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.Joe Groff2014-07-071-3/+11
| | | | | | | It is useful to get the property encoding for an ObjC type without a full ObjCPropertyDecl. llvm-svn: 212496
OpenPOWER on IntegriCloud