summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Win64 ABI shouldn't extend integer type arguments.Julien Lerouge2014-08-263-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: MSVC doesn't extend integer types smaller than 64bit, so to preserve binary compatibility, clang shouldn't either. For example, the following C code built with MSVC: unsigned test(unsigned v); unsigned foobar(unsigned short); int main() { return test(0xffffffff) + foobar(28); } Produces the following: 0000000000000004: B9 FF FF FF FF mov ecx,0FFFFFFFFh 0000000000000009: E8 00 00 00 00 call test 000000000000000E: 89 44 24 20 mov dword ptr [rsp+20h],eax 0000000000000012: 66 B9 1C 00 mov cx,1Ch 0000000000000016: E8 00 00 00 00 call foobar And as you can see, when setting up the call to foobar, only cx is overwritten. If foobar is compiled with clang, then the zero extension added by clang means the rest of the register, which contains garbage, could be used. For example if foobar is: unsigned foobar(unsigned short v) { return v; } Compiled with clang -fomit-frame-pointer -O3 gives the following assembly: foobar: 0000000000000000: 89 C8 mov eax,ecx 0000000000000002: C3 ret And that function would return garbage because the 16 most significant bits of ecx still contain garbage from the first call. With this change, the code for that function is now: foobar: 0000000000000000: 0F B7 C1 movzx eax,cx 0000000000000003: C3 ret Reviewers: chapuni, rnk Reviewed By: rnk Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4380 llvm-svn: 216491
* Clarify comment so this doesn't appear to be a C11-only rule.Richard Smith2014-08-261-0/+3
| | | | llvm-svn: 216490
* Update for llvm api changeRafael Espindola2014-08-261-1/+1
| | | | llvm-svn: 216489
* revert patch r216469.Fariborz Jahanian2014-08-266-5/+6
| | | | llvm-svn: 216485
* [libclang] Fixup the cursor spelling range for C++ destructors, operator ↵Argyrios Kyrtzidis2014-08-262-0/+127
| | | | | | | | overloads, and conversion functions. Patch by Craig Tenenbaum! llvm-svn: 216480
* Fix an incorrect assert condition added in r216410.Alexey Samsonov2014-08-261-1/+1
| | | | llvm-svn: 216479
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-262-7/+7
| | | | llvm-svn: 216478
* Ignore -fdevirtualize and -fdevirtualize-speculatively for gcc compatReid Kleckner2014-08-262-0/+7
| | | | llvm-svn: 216477
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-2611-39/+37
| | | | llvm-svn: 216476
* [test/CodeGen/ARM] Update arm_neon_intrinsics test case to actually test theQuentin Colombet2014-08-261-22/+82
| | | | | | | | | lowering of the intrinsics. Prior to this commit, most of the copy-related intrinsics could be optimized away. The situation is still not ideal as there are several possibilities to lower a given intrinsic. Currently, we match LLVM behavior. llvm-svn: 216474
* Convert MC command line flag for fatal assembler warnings into a properJoerg Sonnenberger2014-08-267-3/+19
| | | | | | flag. llvm-svn: 216472
* c11- Check for c11 language option as documentation saysFariborz Jahanian2014-08-266-6/+5
| | | | | | | | feature is c11 about nested struct declarations must have struct-declarator-list. Without this change, code which was meant for c99 breaks. rdar://18125536 llvm-svn: 216469
* Update for llvm api change.Rafael Espindola2014-08-261-1/+1
| | | | llvm-svn: 216467
* Switching from std::vector to llvm::ArrayRef per post-commit review suggestion.Aaron Ballman2014-08-261-3/+1
| | | | llvm-svn: 216463
* Some versions of MSVC do not support initializer list construction of ↵Aaron Ballman2014-08-261-1/+2
| | | | | | vectors, so this fixes a broken build from r216385. llvm-svn: 216457
* This test was updated in r216397, but was failing on Windows due to mixed ↵Aaron Ballman2014-08-261-1/+1
| | | | | | | | path separators as well as case sensitivity of the "no" in "no such file or directory." Rather than revert this file back to its original form, I've made some incredibly ugly regexes so that it will pass everywhere. Note, the path this test reports a failure on (for my Windows setup) is: E:\llvm\llvm\tools\clang\test\Frontend/doesnotexist/somename llvm-svn: 216456
* arm_acle: Add mappings for dbg intrinsicYi Kong2014-08-263-0/+21
| | | | | | This completes all ACLE hint intrinsics. llvm-svn: 216453
* ARM: Add dbg builtin intrinsicYi Kong2014-08-265-3/+18
| | | | llvm-svn: 216452
* clang-format: New option SpacesInSquareBrackets.Daniel Jasper2014-08-265-4/+42
| | | | | | | | | | | | | | | | Before: int a[5]; a[3] += 42; After: int a[ 5 ]; a[ 3 ] += 42; Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887). Patch by Marek Kurdej, thank you! llvm-svn: 216449
* [ASan/Win] Add an extra thunk.lib to handle stack-use-after-return optionTimur Iskhodzhanov2014-08-262-1/+12
| | | | | | | With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON (PR20214) llvm-svn: 216447
* arm_acle: Implement swap intrinsicYi Kong2014-08-262-0/+18
| | | | | | | Insert the LDREX/STREX instruction sequence specified in ARM ACLE 2.0, as SWP instruction is deprecated since ARMv6. llvm-svn: 216446
* clang-format: Improve handling of block comments in braced lists.Daniel Jasper2014-08-263-20/+18
| | | | | | | | | | | | Before: std::vector<int> v = { 1, 0 /* comment */ }; After: std::vector<int> v = {1, 0 /* comment */}; llvm-svn: 216445
* Passing a variable to std::move now counts as a use for -WuninitializedRichard Trieu2014-08-264-2/+95
| | | | llvm-svn: 216438
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-269-6/+34
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* [clang/asan] call __asan_poison_cxx_array_cookie after operator new[]Kostya Serebryany2014-08-265-10/+81
| | | | | | | | | | | | | | | | | | | | Summary: PR19838 When operator new[] is called and an array cookie is created we want asan to detect buffer overflow bugs that touch the cookie. For that we need to a) poison the shadow for the array cookie (call __asan_poison_cxx_array_cookie). b) ignore the legal accesses to the cookie generated by clang (add 'nosanitize' metadata) Reviewers: timurrrr, samsonov, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4774 llvm-svn: 216434
* Fix typo.Richard Smith2014-08-254-1/+7
| | | | llvm-svn: 216417
* Pass actual CXXConstructExpr instead of argument iteratorsAlexey Samsonov2014-08-253-12/+10
| | | | | | into EmitSynthesizedCXXCopyCtorCall. No functionality change. llvm-svn: 216410
* Objective-C. Allow [super initialize] in an +initializeFariborz Jahanian2014-08-254-10/+30
| | | | | | | implementation but not anywhere else. rdar://16628028 llvm-svn: 216408
* Objective-C modernization. Convert -initWithUTF8String messagingFariborz Jahanian2014-08-255-4/+20
| | | | | | with auto-boxing syntax for literals. rdar://18080352 llvm-svn: 216405
* Pass actual CallExpr instead of CallExpr-specific iteratorsAlexey Samsonov2014-08-255-54/+59
| | | | | | | | | | | into EmitCXXMemberOrOperatorCall methods. In the end we want to make declaration visible in EmitCallArgs() method, that would allow us to alter CodeGen depending on function/parameter attributes. No functionality change. llvm-svn: 216404
* Update for llvm api change.Rafael Espindola2014-08-2517-111/+94
| | | | llvm-svn: 216397
* ASTVector: Fix return value of various insert() methods.Will Dietz2014-08-252-12/+83
| | | | | | | | | Error caught using -fsanitize=pointer-overflow. Expand ASTVectorTest to verify basic behavior, test fails without functionality in this patch. llvm-svn: 216385
* Follow-up to r216380: update test expectationsTimur Iskhodzhanov2014-08-251-6/+6
| | | | llvm-svn: 216381
* [ASan] Rename the ASan dynamic RTTimur Iskhodzhanov2014-08-251-1/+1
| | | | | | Reviewed at http://reviews.llvm.org/D5026 llvm-svn: 216380
* Add hasAttr matcher for declarations.Manuel Klimek2014-08-256-64/+58
| | | | | | | | Delete special-case CUDA attribute matchers. Patch by Jacques Pienaar. llvm-svn: 216379
* clang-format: Understand sequenced casts.Daniel Jasper2014-08-252-2/+4
| | | | | | | | | | | | This fixed llvm.org/PR20712. Before: int i = (int)(int) -2; After: int i = (int)(int)-2; llvm-svn: 216378
* clang-format: Improve formatting of nested builder-type calls.Daniel Jasper2014-08-252-4/+8
| | | | | | | | | | | | Before: f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset( First->LastNewlineOffset)); After: f(FirstToken->WhitespaceRange.getBegin() .getLocWithOffset(First->LastNewlineOffset)); llvm-svn: 216377
* Use range based for loops to avoid needing to re-mention SmallPtrSet size.Craig Topper2014-08-255-54/+35
| | | | llvm-svn: 216370
* [modules] Fix false report of an ODR violation when merging friendRichard Smith2014-08-254-2/+19
| | | | | | | | | | declarations. We can't expect to find them in the canonical definition of the class, because that's not where they live. This means we no longer reject real ODR violations with friend declarations, but we weren't consistently doing so anyway. llvm-svn: 216369
* PR20716 - Crash when recovering from type in known dependent base.Nikola Smiljanic2014-08-243-2/+25
| | | | llvm-svn: 216352
* Frontend: unique_ptr-ifyDylan Noblesmith2014-08-241-4/+4
| | | | | | NFC. llvm-svn: 216347
* Move __vector long deprecation checking into DeclSpec::FinishHal Finkel2014-08-243-6/+13
| | | | | | | | | | | | __vector long is deprecated, but __vector long long is not. As a result, we cannot check for __vector long (to issue the deprecation warning) as we parse the type because we need to know how many 'long's we have first. DeclSpec::Finish seems like a more-appropriate place to perform the check (which places it with several other similar Altivec vector checks). Fixes PR20720. llvm-svn: 216342
* Implement __builtin_signbitl for PowerPCHal Finkel2014-08-242-2/+19
| | | | | | | | | | | PowerPC uses the special PPC_FP128 type for long double on Linux, which is composed of two 64-bit doubles. The higher-order double (which contains the overall sign) comes first, and so the __builtin_signbitl implementation requires special handling to extract the sign bit. Fixes PR20691. llvm-svn: 216341
* Don't assert on different DLL attributes in template and explicit ↵Hans Wennborg2014-08-245-12/+44
| | | | | | | | | | | | | | | | | | | | instantiation (PR20137) We would previously assert (a decl cannot have two DLL attributes) on this code: template <typename T> struct __declspec(dllimport) S { T f() { return T(); } }; template struct __declspec(dllexport) S<int>; The problem was that when instantiating, we would take the attribute from the template even if the instantiation itself already had an attribute. Also, don't inherit DLL attributes from the template to its members before instantiation, as the attribute may change. I couldn't figure out what MinGW does here, so I'm leaving that open. At least we're not asserting anymore. llvm-svn: 216340
* Add another test for DLL attribute inheritance to partial specializationsHans Wennborg2014-08-231-0/+8
| | | | llvm-svn: 216337
* Fix CodeGenCXX/dllexport.cpp test. Somehow this slipped out of my previous ↵Hans Wennborg2014-08-231-1/+1
| | | | | | commit. llvm-svn: 216334
* MS ABI: Inherit DLL attributes to partial class template specializationsHans Wennborg2014-08-233-0/+30
| | | | llvm-svn: 216333
* checkDLLAttribute: remove a redundant dyn_castHans Wennborg2014-08-231-21/+19
| | | | | | The same dyn_cast was done earlier in the function. No functionality change. llvm-svn: 216326
* CodeGen: Skip unnamed bitfields when handling designated initializersDavid Majnemer2014-08-232-1/+12
| | | | | | | We would accidently initialize unnamed bitfields instead of the following field. llvm-svn: 216313
* [modules] When merging a tag declaration that has a typedef name for linkageRichard Smith2014-08-235-7/+88
| | | | | | | purposes, look for other typedefs with that same name and merge into their named tag declaration if there is one. llvm-svn: 216312
OpenPOWER on IntegriCloud