summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Certain multi-platform languages, such as OpenCL, have the concept ofDavid Tweed2013-09-132-2/+32
| | | | | | | | | | | | | | address spaces which is both (1) a "semantic" concept and (2) possibly a hardware level restriction. It is desirable to be able to discard/merge the LLVM-level address spaces on arguments for which there is no difference to the current backend while keeping track of the semantic address spaces in a funciton prototype. To do this enable addition of the address space into the name-mangling process. Add some tests to document this behaviour against inadvertent changes. Patch by Michele Scandale! llvm-svn: 190684
* Add "native" to config.available_features, to make it easier to disable ↵Amaury de la Vieuville2013-09-134-1/+8
| | | | | | | | non-x-compile-safe tests Patch by Artyom Skrobov! llvm-svn: 190681
* [-cxx-abi microsoft] Mangle user defined entry points properlyDavid Majnemer2013-09-131-0/+20
| | | | | | | | | | | | | | | | Summary: Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain" are never mangled regardless of linkage, even when compiling for kernel mode. Depends on D1655 Reviewers: timurrrr, pcc, rnk, whunt CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1670 llvm-svn: 190675
* [-cxx-abi microsoft] Mangle declarations inside extern "C"David Majnemer2013-09-131-0/+10
| | | | | | | | | | | | | | | Summary: This is a first step to getting extern "C" working properly inside clang. There are a number of quirks but mangling declarations inside such a function are a good first step. Reviewers: timurrrr, pcc, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1655 llvm-svn: 190671
* CHECK -> CHECK-DAGDavid Majnemer2013-09-131-82/+82
| | | | llvm-svn: 190670
* Refactor the uninitialized field visitor. Also moved the calls to the visitorRichard Trieu2013-09-131-0/+38
| | | | | | | later in the code so that the expressions will have addition processing first. This catches a few additional cases of uninitialized uses of class fields. llvm-svn: 190657
* Restore the sqrt -> llvm.sqrt mapping in fast-math modeHal Finkel2013-09-121-0/+5
| | | | | | | | | | | | | | | This restores the sqrt -> llvm.sqrt mapping, but only in fast-math mode (specifically, when the UnsafeFPMath or NoNaNsFPMath CodeGen options are enabled). The @llvm.sqrt* intrinsics have slightly different semantics from the libm call, specifically, they are undefined when given a non-zero negative number (the libm calls will always return NaN for any negative number). This mapping was removed in r100613, and replaced with a TODO, but at that time the fast-math flags were not yet implemented. Now that we have these, restoring this mapping is important because it will enable autovectorization of sqrt calls in loops (at least in fast-math mode). llvm-svn: 190646
* PR13657 (and duplicates):Richard Smith2013-09-123-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a comma occurs in a default argument or default initializer within a class, disambiguate whether it is part of the initializer or whether it ends the initializer. The way this works (which I will be proposing for standardization) is to treat the comma as ending the default argument or default initializer if the following token sequence matches the syntactic constraints of a parameter-declaration-clause or init-declarator-list (respectively). This is both consistent with the disambiguation rules elsewhere (where entities are treated as declarations if they can be), and should have no regressions over our old behavior. I think it might also disambiguate all cases correctly, but I don't have a proof of that. There is an annoyance here: because we're performing a tentative parse in a situation where we may not have seen declarations of all relevant entities (if the comma is part of the initializer, lookup may find entites declared later in the class), we need to turn off typo-correction and diagnostics during the tentative parse, and in the rare case that we decide the comma is part of the initializer, we need to revert all token annotations we performed while disambiguating. Any diagnostics that occur outside of the immediate context of the tentative parse (for instance, if we trigger the implicit instantiation of a class template) are *not* suppressed, mirroring the usual rules for a SFINAE context. llvm-svn: 190639
* Fix regression from r190427.Eli Friedman2013-09-121-0/+5
| | | | | | <rdar://problem/14970968> llvm-svn: 190635
* PR16054: Slight strengthening for -Wsometimes-uninitialized: if we use aRichard Smith2013-09-121-8/+50
| | | | | | | | | | | variable uninitialized every time we reach its (reachable) declaration, or every time we call the surrounding function, promote the warning from -Wmaybe-uninitialized to -Wsometimes-uninitialized. This is still slightly weaker than desired: we should, in general, warn if a use is uninitialized the first time it is evaluated. llvm-svn: 190623
* Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.Hans Wennborg2013-09-121-0/+1
| | | | | | | | | | | | | | | | | This moves the code to Job.cpp, which seems like a more natural fit, and replaces the "is this a JobList? is this a Command?" logic with a virtual function call. It also removes the code duplication between PrintJob and PrintDiagnosticJob and simplifies the code a little. There's no functionality change here, except that the Executable is now always printed within quotes, whereas it would previously not be quoted in crash reports, which I think was a bug. Differential Revision: http://llvm-reviews.chandlerc.com/D1653 llvm-svn: 190620
* Fix the end-location of a CXXTemporaryObjectExpr when it is created with a ↵Argyrios Kyrtzidis2013-09-111-0/+44
| | | | | | | | initializer_list. rdar://14887351 llvm-svn: 190561
* clang/test/FixIt/fixit-unicode-with-utf8-output.c: Remove XFAIL.NAKAMURA Takumi2013-09-111-1/+0
| | | | | | | | It'd be another issue that the terminal and stdout(including redirects) with utf8. This test XPASSed on Win32, at least on Lit. FYI, we don't use a triplet like "-win64" anywhere. llvm-svn: 190559
* ObjectiveC migration. NS_RETURNS_NOT_RETAINED is the default forFariborz Jahanian2013-09-111-19/+19
| | | | | | | unknown methods which return Cocoa objects. No need to annotate such methods. llvm-svn: 190555
* Tablegen now generates a StringSwitch for attributes containing enumeration ↵Aaron Ballman2013-09-112-3/+2
| | | | | | arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required. llvm-svn: 190545
* ObjectiveC migrator. Modify inferred property nameFariborz Jahanian2013-09-112-0/+12
| | | | | | | | such that it does not lower case the staring property name if getter name (after "get" prefix) starts with two upper case letters. llvm-svn: 190539
* Test for correct usage of columnWidth in clang fixit hints.Alexander Kornienko2013-09-112-3/+37
| | | | | | | | | | | | | | | | | Summary: This test only works on systems capable of outputting UTF-8 encoded text on the standard output (tested on linux and OS X, should XFAIL on windows, if I haven't messed up the XFAIL line). Reviewers: jordan_rose Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1607 llvm-svn: 190537
* ObjectiveC migrator. methods which look like a getter andFariborz Jahanian2013-09-112-0/+16
| | | | | | start with "get" are inferreed as a readonly properties. llvm-svn: 190532
* Added regression tests.Serge Pavlov2013-09-111-0/+13
| | | | llvm-svn: 190531
* [analyzer] Handle zeroing constructors for fields of structs with empty bases.Jordan Rose2013-09-111-0/+24
| | | | | | | | | | | | | | | | | | | RegionStore tries to protect against accidentally initializing the same region twice, but it doesn't take subregions into account very well. If the outer region being initialized is a struct with an empty base class, the offset of the first field in the struct will be 0. When we initialize the base class, we may invalidate the contents of the struct by providing a default value of Unknown (or some new symbol). We then go to initialize the member with a zeroing constructor, only to find that the region at that offset in the struct already has a value. The best we can do here is to invalidate that value and continue; neither the old default value nor the new 0 is correct for the entire struct after the member constructor call. The correct solution for this is to track region extents in the store. <rdar://problem/14914316> llvm-svn: 190530
* clang-cl: Warn about overriding /MD with /MT etc.Hans Wennborg2013-09-111-0/+4
| | | | | | | This also bakes the /M options into a separate option group to make them easier to refer to from the code. llvm-svn: 190529
* fix xcore-opts.c testRobert Lytton2013-09-111-1/+1
| | | | llvm-svn: 190526
* Adding some additional test cases for the cleanup attribute.Aaron Ballman2013-09-111-0/+11
| | | | llvm-svn: 190525
* Fix the ASan dll_thunk pathTimur Iskhodzhanov2013-09-111-1/+1
| | | | llvm-svn: 190516
* Split -Wunused-variable warning.Daniel Jasper2013-09-111-0/+6
| | | | | | | | | | | With r190382, -Wunused-variable warns about unused const variables when appropriate. For codebases that use -Werror, this poses a problem as existing unused const variables need to be cleaned up first. To make the transistion easier, this patch splits -Wunused-variable by pulling out an additional -Wunused-const-variable (by default activated along with -Wunused-variable). llvm-svn: 190508
* [mips][msa] Corrected the definition of the dotp_[su].[hwd] intrinsicsDaniel Sanders2013-09-111-6/+6
| | | | | | | The elements of the operands should be half the width of the elements of the result. llvm-svn: 190505
* Support for modular module-map-filesDaniel Jasper2013-09-115-0/+23
| | | | | | | | | | | | | | | | | | | This patch is the first step to make module-map-files modular (instead of requiring a single "module.map"-file per include directory). This step adds a new "extern module" declaration that enables module-map-files to reference one another along with a very basic implementation. The next steps are: * Combine this with the use-declaration (from http://llvm-reviews.chandlerc.com/D1546) in order to only load module map files required for a specific compilation. * Add an additional flag to start with a specific module-map-file (instead of requiring there to be at least one "module.map"). Review: http://llvm-reviews.chandlerc.com/D1637 llvm-svn: 190497
* Fix a bug where -msse followed by -mno-sse would leave MMX enabled.Craig Topper2013-09-111-0/+12
| | | | llvm-svn: 190496
* [-cxx-abi microsoft] Canonicalize array parameters betterDavid Majnemer2013-09-111-0/+34
| | | | | | | | | | | | | | | Summary: More accurately characterize the nature of array parameters. Doing this removes false back-reference opportunities. Remove some hacks now that we characterize these better. Reviewers: rnk, timurrrr, whunt, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1626 llvm-svn: 190488
* volatile types are not trivially copyable.Eli Friedman2013-09-111-0/+3
| | | | | | PR17123. llvm-svn: 190484
* Fix test.Eli Friedman2013-09-111-1/+1
| | | | llvm-svn: 190483
* Fix is_trivially_constructible preconditions.Eli Friedman2013-09-111-1/+8
| | | | | | | | | Fixes a crash in cases where the first argument was an incomplete type or an uninstantiated template type. <rdar://problem/14938471> llvm-svn: 190482
* Disable the bool and enum sanitizers when emitting the implicitly-defined copyNick Lewycky2013-09-111-2/+85
| | | | | | constructor, copy assignment operator and move assignment operator. llvm-svn: 190481
* The cleanup attribute no longer uses an unresolved, simple identifier as its ↵Aaron Ballman2013-09-114-5/+46
| | | | | | argument. Instead, it takes an expression that is fully resolved. llvm-svn: 190476
* PR17075: When performing partial ordering of a member function against aRichard Smith2013-09-111-0/+7
| | | | | | | | | | | non-member function, the number of arguments in the two candidate calls will be different (the non-member call will have one extra argument). We used to get confused by this, and fail to compare the last argument when testing whether the member is better, resulting in us always thinking it is, even if the non-member is more specialized in the last argument. llvm-svn: 190470
* Add -fansi-escape-codes optionNico Rieck2013-09-111-0/+4
| | | | | | | | | | | | | Some build systems use pipes for stdin/stderr. On nix-ish platforms colored output can be forced by -fcolor-diagnostics. On Windows this option has no effect in these cases because LLVM uses the console API (which only operates on the console buffer) even if a console wrapper capable of interpreting ANSI escape codes is used. The -fansi-escape-codes option allows switching from the console API to ANSI escape codes. It has no effect on other platforms. llvm-svn: 190464
* Ignore noreturn when checking function template specializationsReid Kleckner2013-09-101-0/+8
| | | | | | | | | | As requested when applying the same logic to calling conventions. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1634 llvm-svn: 190441
* PR5683: Issue a warning when subtracting pointers to types of zero size, andRichard Smith2013-09-102-1/+60
| | | | | | | treat such subtractions as being non-constant. Patch by Serge Pavlov! With a few tweaks by me. llvm-svn: 190439
* Fix regression from r190382.Eli Friedman2013-09-101-0/+9
| | | | | | | | | Make sure we perform the correct "referenced-but-not-used" check for static member constants. Fixes bug reported on cfe-commits by Alexey Samsonov. llvm-svn: 190437
* Fix cl-link.c test failure on Mac platformsHans Wennborg2013-09-101-2/+2
| | | | | | | The test filename (%s) is easily confused with an option when it starts with /Users... llvm-svn: 190435
* [ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC doesReid Kleckner2013-09-101-4/+4
| | | | | | | | | | | | Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ. Reviewers: timurrrr CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1477 llvm-svn: 190434
* Remove Windows line-endings in two clang-cl test files.Hans Wennborg2013-09-102-121/+121
| | | | llvm-svn: 190432
* clang-cl: Support building DLLs (PR17083)Hans Wennborg2013-09-103-6/+95
| | | | | | | | This adds driver support for building DLLs (the /LD and /LDd flags). It basically does two things: runtime selection and passing -dll and -implib to the linker. llvm-svn: 190428
* [ms-cxxabi] Implement guard variables for static initializationReid Kleckner2013-09-102-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | Static locals requiring initialization are not thread safe on Windows. Unfortunately, it's possible to create static locals that are actually externally visible with inline functions and templates. As a result, we have to implement an initialization guard scheme that is compatible with TUs built by MSVC, which makes thread safety prohibitively difficult. MSVC's scheme is that every function that requires a guard gets an i32 bitfield. Each static local is assigned a bit that indicates if it has been initialized, up to 32 bits, at which point a new bitfield is created. MSVC rejects inline functions with more than 32 static locals, and the externally visible mangling (?_B) only allows for one guard variable per function. On Eli's recommendation, I used MangleNumberingContext to track which bit each static corresponds to. Implements PR16888. Reviewers: rjmccall, eli.friedman Differential Revision: http://llvm-reviews.chandlerc.com/D1416 llvm-svn: 190427
* ObjectiveC migrator: rename inferred isXXX property,Fariborz Jahanian2013-09-102-1/+3
| | | | | | with a suitable 'getter' attribute. llvm-svn: 190420
* Allow _clang-format as alternative to .clang-format config filenameHans Wennborg2013-09-101-0/+5
| | | | | | | | | | | Dotfiles are impractical on Windows. This makes clang-format search for the style configuration file as '_clang-format' in addition to the usual '.clang-format'. This is similar to how VIM searches for '_vimrc' on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1629 llvm-svn: 190413
* [mips][msa] Removed unsupported dot product instructions (dotp_[su].b).Daniel Sanders2013-09-101-2/+0
| | | | | | The dotp_[su].b instructions never existed in any revision of the MSA spec. llvm-svn: 190399
* Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.Craig Topper2013-09-101-0/+12
| | | | | | | Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled. Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled. llvm-svn: 190387
* Generate code for the move assignment operator using memcpy, the same as we doNick Lewycky2013-09-101-0/+26
| | | | | | for the copy assignment operator. llvm-svn: 190385
* Make -Wunused warning rules more consistent.Eli Friedman2013-09-102-24/+44
| | | | | | | | | | | | | | | This patch does a few different things. This patch improves unused var diags for const vars: we no longer unconditionally suppress diagnostics for const vars, instead only suppressing the diagnostic when the declaration appears to be useful. This patch also makes us more consistently use whether a variable/function is declared in the main file to suppress diagnostics where appropriate. Fixes <rdar://problem/14907887>. llvm-svn: 190382
OpenPOWER on IntegriCloud