summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Initial parsing and sema analysis for 'section' directive.Alexey Bataev2014-06-2627-33/+335
| | | | llvm-svn: 211767
* Sema: Allow dllimport entities in template args for mingwDavid Majnemer2014-06-262-20/+28
| | | | | | | | | | | | | | Previously dllimport variables inside of template arguments relied on not using the C++11 codepath when -fms-compatibility was set. While this allowed us to achieve compatibility with MSVC, it did so at the expense of MingW. Instead, try to use the DeclRefExpr we dig out of the template argument. If it has the dllimport attribute, accept it and skip the C++11 null-pointer check. llvm-svn: 211766
* Convert some function arguments to use ArrayRef.Craig Topper2014-06-268-91/+63
| | | | llvm-svn: 211764
* Convert StringLiteralParser constructor to use ArrayRef instead of a pointer ↵Craig Topper2014-06-2610-30/+29
| | | | | | and count. llvm-svn: 211763
* Make test from r211758 portableAlp Toker2014-06-261-0/+1
| | | | | | | It turns out the -fblocks option is determined by the default tooling target and not implied by the other two flags. llvm-svn: 211761
* CodeGen: Improve warnings about uninstrumented files when profilingJustin Bogner2014-06-269-12/+95
| | | | | | | | | Improve the warning when building with -fprofile-instr-use and a file appears not to have been profiled at all. This keys on whether a function is defined in the main file or not to avoid false negatives when one includes a header with functions that have been profiled. llvm-svn: 211760
* Reformat RAVs to sync up following recent updatesAlp Toker2014-06-262-42/+41
| | | | llvm-svn: 211759
* RAV: visit copy expressions of captured variables in blocks (ObjC++11)Alp Toker2014-06-264-1/+32
| | | | | | Patch by Mathieu Baudet. llvm-svn: 211758
* Forward -u to the linker on gnutools toolchainsReid Kleckner2014-06-262-0/+7
| | | | | | | | | | | | | | | | Summary: The BSDs and Darwin all forward the whole 'u' group, but gcc only forwards -u so far as I can tell. I only forward -u, since that's a minimal change, and many people object to magically recognizing and forwarding linker arguments. Reviewers: chandlerc, joerg Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4304 llvm-svn: 211756
* Make -Wincomplete-umbrella go through the VFSBen Langmuir2014-06-257-4/+42
| | | | | | | By using vfs::recursive_directory_iterator, this warning will now fire when some or all of a module's headers are from VFS mappings. llvm-svn: 211746
* Make PR20038.cpp test case portable to non-Itanium ABIsDavid Blaikie2014-06-251-1/+1
| | | | | | | The only call in this function is to the dtor, so there's no need to name a non-portable mangled function name to match it. llvm-svn: 211742
* Remove REQUIRES lines from portable testsAlp Toker2014-06-254-6/+0
| | | | | | These tests are target-independent and shouldn't ever be suppressed. llvm-svn: 211738
* Don't allow dllimport variables in constant initializersHans Wennborg2014-06-255-13/+14
| | | | | | | | | | | | | | | | | This is a follow-up to David's r211677. For the following code, we would end up referring to 'foo' in the initializer for 'arr', and then fail to link, because 'foo' is dllimport and needs to be accessed through the __imp_?foo. __declspec(dllimport) extern const char foo[]; const char* f() { static const char* const arr[] = { foo }; return arr[0]; } Differential Revision: http://reviews.llvm.org/D4299 llvm-svn: 211736
* fixed typos in commentSanjay Patel2014-06-251-1/+1
| | | | llvm-svn: 211734
* Add vfs::recursive_directory_iteratorBen Langmuir2014-06-253-8/+168
| | | | | | | | | For now, this is only used by its unit tests. It is similar to the API in llvm::sys::fs::recursive_directory_iterator, but without some of the more complex features like requesting that the iterator not recurse into the next directory, for example. llvm-svn: 211732
* MS ABI: Propagate class-level DLL attributes to class template ↵Hans Wennborg2014-06-256-5/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | specialization bases (PR11170) Consider the following code: template <typename T> class Base {}; class __declspec(dllexport) class Derived : public Base<int> {} When the base of an exported or imported class is a class template specialization, MSVC will propagate the dll attribute to the base. In the example code, Base<int> becomes a dllexported class. This commit makes Clang do the proopagation when the base hasn't been instantiated yet, and warns about it being unsupported otherwise. This is different from MSVC, which allows changing a specialization back and forth between dllimport and dllexport and seems to let the last one win. Changing the dll attribute after instantiation would be hard for us, and doesn't seem to come up in practice, so I think this is a reasonable limitation to have. MinGW doesn't do this kind of propagation. Differential Revision: http://reviews.llvm.org/D4264 llvm-svn: 211725
* PR20038: DebugInfo: Call sites without DebugLocs for temporary dtors after a ↵David Blaikie2014-06-252-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | conditional With && at the top level of an expression, the last thing done when emitting the expression was an unconditional jump to the cleanup block. To reduce the amount of stepping, the DebugLoc is omitted from the unconditional jump. This is done by clearing the IRBuilder's "CurrentDebugLocation"*. If this is not set to some non-empty value before the cleanup block is emitted, the cleanups don't get a location either. If a call without a location is emitted in a function with debug info, and that call is then inlined - bad things happen. (without a location for the call site, the inliner would just leave the inlined DebugLocs as they were - pointing to roots in the original function, not inlined into the current function) Follow up commit to LLVM will ensure that breaking the invariants of the DebugLoc chains by having chains that don't lead to the current function will fail assertions, so we shouldn't accidentally slip any of these cases in anymore. Those assertions may reveal further cases that need to be fixed in clang, though I've tried to test heavily to avoid that. * See r128471, r128513 for the code that clears the CurrentDebugLocation. Simply removing this code or moving the code into IRBuilder to apply to all unconditional branches would regress desired behavior, unfortunately. llvm-svn: 211722
* Fix treatment of types defined in function prototypeSerge Pavlov2014-06-254-14/+76
| | | | | | | | | | | | Types defined in function prototype are diagnosed earlier in C++ compilation. They are put into declaration context where the prototype is introduced. Later on, when FunctionDecl object is created, these types are moved into the function context. This patch fixes PR19018 and PR18963. Differential Revision: http://reviews.llvm.org/D4145 llvm-svn: 211718
* Headers: be a bit more careful about inline asmSaleem Abdulrasool2014-06-251-0/+12
| | | | | | | | | Conditionally include x86intrin.h if we are building for x86 or x86_64. Conditionalise definition of inline assembly routines which use x86 or x86_64 inline assembly. This is needed as clang can target Windows on ARM where these definitions may be included into user code. llvm-svn: 211716
* Rename loop unrolling and loop vectorizer metadata to have a common prefix.Eli Bendersky2014-06-255-27/+26
| | | | | | | | | | | | | | | | | | | [Clang part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. llvm-svn: 211712
* Fixing the RST markup for the #pragma loop attribute documentation.Aaron Ballman2014-06-251-2/+2
| | | | llvm-svn: 211693
* Fixing the position of the supported syntax marker when generating attribute ↵Aaron Ballman2014-06-251-1/+1
| | | | | | documentation. llvm-svn: 211692
* Escaping a literal character to fix an RST warning.Aaron Ballman2014-06-251-1/+1
| | | | llvm-svn: 211690
* Align with new GCC options for x86 AndroidAlexey Volkov2014-06-252-4/+9
| | | | | | | | | 32-bit: +ssse3 64-bit: +sse4.2 +popcnt Differential Revision: http://reviews.llvm.org/D4287 llvm-svn: 211688
* CHECK-LABEL'ify this test.James Molloy2014-06-251-1965/+1965
| | | | llvm-svn: 211687
* [AArch32] Fix a stupid error in an architectural guardJames Molloy2014-06-252-34/+50
| | | | | | The < 8 instead of <= 8 meant that a bunch of vreinterprets were not available on v8 AArch32. Simplify the guard to just !defined(aarch64) while we're at it, and enable some v8 AArch32 testing. llvm-svn: 211686
* [OPENMP] Initial support for 'sections' directive.Alexey Bataev2014-06-2531-7/+1895
| | | | llvm-svn: 211685
* AST: Initialization with dllimport functions in CDavid Majnemer2014-06-254-9/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C++ language requires that the address of a function be the same across all translation units. To make __declspec(dllimport) useful, this means that a dllimported function must also obey this rule. MSVC implements this by dynamically querying the import address table located in the linked executable. This means that the address of such a function in C++ is not constant (which violates other rules). However, the C language has no notion of ODR nor does it permit dynamic initialization whatsoever. This requires implementations to _not_ dynamically query the import address table and instead utilize a wrapper function that will be synthesized by the linker which will eventually query the import address table. The effect this has is, to say the least, perplexing. Consider the following C program: __declspec(dllimport) void f(void); typedef void (*fp)(void); static const fp var = &f; const fp fun() { return &f; } int main() { return fun() == var; } MSVC will statically initialize "var" with the address of the wrapper function and "fun" returns the address of the actual imported function. This means that "main" will return false! Note that LLVM's optimizers are strong enough to figure out that "main" should return true. However, this result is dependent on having optimizations enabled! N.B. This change also permits the usage of dllimport declarators inside of template arguments; they are sufficiently constant for such a purpose. Add tests to make sure we don't regress here. llvm-svn: 211677
* Added a test to ensure -Wimplicit-fallthrough works with -fblocks correctly.Alexander Kornienko2014-06-251-0/+19
| | | | llvm-svn: 211676
* [OPENMP] OMPSimdDirective and OMPForDirective: added initialization for ↵Alexey Bataev2014-06-253-29/+36
| | | | | | CollapsedNum member. llvm-svn: 211672
* Don't go through the TypeSourceInfo when getting the SourceRange.Zachary Turner2014-06-251-3/+3
| | | | | | | | | | | | VarDecl provides a method getSourceRange(), which provides a more robust way of getting the SourceRange since the TypeSourceInfo can be null in certain cases. Reviewed by: majnemer Differential Revision: http://reviews.llvm.org/D4281 llvm-svn: 211667
* [Driver] Follow-up to r211598, r211663. Do not build a dynamic linkerSimon Atanasyan2014-06-251-6/+6
| | | | | | path using sub-strings concatenation. Return the whole string explicitly. llvm-svn: 211665
* Tools.cpp: Update getLinuxDynamicLinker() to return Twine instead of ↵NAKAMURA Takumi2014-06-251-3/+3
| | | | | | StringRef, since r211598 has introduced manipulation of return string. llvm-svn: 211663
* VirtualFileSystemTest.cpp: Get rid of initializer list on std::vector, to ↵NAKAMURA Takumi2014-06-251-21/+29
| | | | | | appease msc17. llvm-svn: 211662
* Reformat.NAKAMURA Takumi2014-06-252-13/+12
| | | | llvm-svn: 211661
* [OPENMP] Improved code and replaced struct by lambda.Alexey Bataev2014-06-252-21/+16
| | | | llvm-svn: 211660
* Implement predefined stdint macrosJF Bastien2014-06-255-9/+1856
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* Fix parsing nested __if_exists blocksReid Kleckner2014-06-252-8/+24
| | | | | | | | | | | Rather than having kw___if_exists be a special case of ParseCompoundStatementBody, we can look for kw___if_exists in the big switch over for valid statement tokens in ParseStatementOrDeclaration. Nested __if_exists blocks are used in the DECLARE_REGISTRY_RESOURCEID macro from atlcom.h. llvm-svn: 211654
* Add a missing test for the __if_exists extensionReid Kleckner2014-06-251-0/+10
| | | | | | | MSVC does not create a new scope for the body of an __if_exists compound statement. Clang already gets this right today, but it was untested. llvm-svn: 211650
* Split tests for __if_exists out into their own fileReid Kleckner2014-06-252-97/+93
| | | | llvm-svn: 211649
* MS ABI: Ignore dll attributes on partial template specializationsHans Wennborg2014-06-245-3/+57
| | | | llvm-svn: 211648
* Merge handleDLLImportAttr and handleDLLExportAttr into one function.Hans Wennborg2014-06-241-13/+6
| | | | llvm-svn: 211647
* Provide a better diagnostic when braces are put before the identifier.Richard Trieu2014-06-245-6/+351
| | | | | | | | | | | | | | | | | When a user types: int [4] foo; assume that the user means: int foo[4]; Update the information for 'foo' to prevent additional errors, and provide a fix-it hint to move the brackets to the correct location. Additionally, suggest parens for types that require it, such as: int [4] *foo; to: int (*foo)[4]; llvm-svn: 211641
* Fix test issues from r211623 and remove test-only APIBen Langmuir2014-06-242-27/+21
| | | | | | | | | | | 1) missing iterator bits needed by libstdc++4.7 Using find_if was convenient, but since operator++ wasn't a good interface anyway, I just replaced with a range-based for loop and removed operator++ from the directory_iterator class. 2) stop relying on order of iterating real files llvm-svn: 211633
* Forgot to add file in r211631Matt Arsenault2014-06-241-0/+20
| | | | llvm-svn: 211632
* Add R600 builtin codegen.Matt Arsenault2014-06-246-3/+88
| | | | llvm-svn: 211631
* Fix missing C++ mode commentMatt Arsenault2014-06-241-1/+1
| | | | llvm-svn: 211630
* Correctly Load Mixed FP-GP Variadic Arguments for x86-64.Rafael Espindola2014-06-242-2/+17
| | | | | | | | | | | | | | | | | | | | According to the x86-64 ABI, structures with both floating point and integer members are split between floating-point and general purpose registers, and consecutive 32-bit floats can be packed into a single floating point register. In the case of variadic functions these are stored to memory and the position recorded in the va_list. This was already correctly implemented in llvm.va_start. The problem is that the code in clang for implementing va_arg was reading floating point registers from the wrong location. Patch by Thomas Jablin. Fixes PR20018. llvm-svn: 211626
* Disable the bits of r211623 that broke the botsBen Langmuir2014-06-241-15/+16
| | | | | | | Part of my test seems to rely on iterator bits that I didn't implement, at least in the gcc bots. Disabling while I investigate. llvm-svn: 211625
* Use appropriate default PIE settings for OpenBSD.Brad Smith2014-06-242-0/+31
| | | | llvm-svn: 211624
OpenPOWER on IntegriCloud