- Dec 03, 2014
-
-
Nico Weber authored
Consider this program: struct A { virtual void operator-() { printf("base\n"); } }; struct B final : public A { virtual void operator-() override { printf("derived\n"); } }; int main() { B* b = new B; -static_cast<A&>(*b); } Before this patch, clang saw the virtual call to A::operator-(), figured out that it can be devirtualized, and then just called A::operator-() directly, without going through the vtable. Instead, it should've looked up which operator-() the call devirtualizes to and should've called that. For regular virtual member calls, clang gets all this right already. So instead of giving EmitCXXOperatorMemberCallee() all the logic that EmitCXXMemberCallExpr() already has, cut the latter function into two pieces, call the second piece EmitCXXMemberOrOperatorMemberCallExpr(), and use it also to generate code for calls to virtual member operators. This way, virtual overloaded operators automatically don't get devirtualized if they have covariant returns (like it was done for regular calls in r218602), etc. This also happens to fix (or at least improve) codegen for explicit constructor calls (`A a; a.A::A()`) in MS mode with -fsanitize-address-field-padding=1. (This adjustment for virtual operator calls seems still wrong with the MS ABI.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223185 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
PR21706: -Wunsequenced was missing warnings when leaving a sequenced region that contained side effects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223184 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Majnemer authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223179 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kaelyn Takata authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223177 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Majnemer authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223176 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Majnemer authored
Implement _umul128; it provides the high and low halves of a 128-bit multiply. We can simply use our __int128 arithmetic to implement this, we generate great code for it: movq %rdx, %rax mulq %rcx movq %rdx, (%r8) retq Differential Revision: http://reviews.llvm.org/D6486 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223175 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Bogner authored
There's no need to use different names for the local variables than we use in the profile itself, and it's a bit simpler and easier to debug if we're consistent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223173 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 02, 2014
-
-
Fariborz Jahanian authored
rdar://19116886 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223168 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Bogner authored
It doesn't make much sense to have std::unique_ptrs of std::string and std::vector. Avoid some useless indirection by using these types directly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223166 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kaelyn Takata authored
Also have CorrectDelayedTyposInExpr check that the Expr* isn't null before trying to access its members. Fixes PR21679. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223162 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223149 91177308-0d34-0410-b5e6-96231b3b80d8
-
JF Bastien authored
Summary: In particular, remove the defaults and reorder fields so it matches the result of DataLayout::getStringDescription(). Change by David Neto. Reviewers: dschuff, sdt Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6482 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223140 91177308-0d34-0410-b5e6-96231b3b80d8
-
Fariborz Jahanian authored
expressions. It fixes crash when mangling name for block's helper function used inside a constructor/destructor. rdar://19065361. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223136 91177308-0d34-0410-b5e6-96231b3b80d8
-
Samuel Benzaquen authored
Summary: Skip some unnecessary type checks wrt DynTypedNodes. Add DynTypedNode::getUnchecked() to skip the runtime check when the type is known. Speed up DynTypedNode::operator== by using isSame() instead of isBaseOf(). Skip the type check in MatcherInterface<T>::matches(). All calls come from DynTypedMatcher::matches(), which already did the type check. This change speeds up our clang-tidy benchmark by ~4%. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6468 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223134 91177308-0d34-0410-b5e6-96231b3b80d8
-
Anton Korobeynikov authored
ARM ABI specifies that all the libcalls use soft FP ABI (even hard FP binaries). These days clang emits _mulsc3 / _muldc3 calls with default (C) calling convention which would be translated into AAPCS_VFP LLVM calling and thus the result of complex multiplication will be bogus. Introduce a way for a target to specify explicitly calling convention for libcalls. Right now this is temporary correctness fix. Ultimately, we'll end with intrinsic for complex multiplication and all calling convention decisions for libcalls will be put into backend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223123 91177308-0d34-0410-b5e6-96231b3b80d8
-
Serge Pavlov authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223120 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223118 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
With alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; Without alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; This fixes llvm.org/PR21666. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223117 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Holewinski authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223116 91177308-0d34-0410-b5e6-96231b3b80d8
-
Serge Pavlov authored
Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223114 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; After: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; Not particularly pretty, but can probably help to uncover bugs. And if this bugs somebody, parentheses can help. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223111 91177308-0d34-0410-b5e6-96231b3b80d8
-
Bob Wilson authored
This reverts commit r176892. I had reverted this a while back to give Chromium more time to update, and Nico says it should be OK now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223108 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223107 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
If the output of 'ld -v' didn't match the regexes, CMake would previously error with a message like: CMake Error at tools/clang/CMakeLists.txt:269 (string): string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched an empty string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223106 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223105 91177308-0d34-0410-b5e6-96231b3b80d8
-
Chandler Carruth authored
I'm explicitly setting LC_ALL=C somewhat for documentation, but hopefully this also removes some host variation from the test results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223102 91177308-0d34-0410-b5e6-96231b3b80d8
-
Chandler Carruth authored
environment variable is changed to strange things out from under it. Prior to r223099 in LLVM, these test cases would crash in various ways (assert fails, stack exhaustion, etc.). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223100 91177308-0d34-0410-b5e6-96231b3b80d8
-
Bob Wilson authored
I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223097 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223095 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nikola Smiljanic authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223090 91177308-0d34-0410-b5e6-96231b3b80d8
-
Zachary Turner authored
Using lld on Windows requires calling link-lld.exe instead of lld.exe. This patch puts this knowledge into clang so that when using the GCC style clang driver, it can properly delegate to lld. Differential Revision: http://reviews.llvm.org/D6428 Reviewed by: Reid Kleckner, Rui Ueyama git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223086 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 01, 2014
-
-
Reid Kleckner authored
Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223079 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
fallthrough happened to do the right thing in both cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223064 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
There was no test coverage for this before: Modifiying EmitCXXOperatorMemberCallee() to not call CanDevirtualizeMemberFunctionCall() didn't make any test fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223056 91177308-0d34-0410-b5e6-96231b3b80d8
-
Matt Arsenault authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223046 91177308-0d34-0410-b5e6-96231b3b80d8
-
Samuel Benzaquen authored
Summary: Speed up the variadic matchers by removing one indirect call. Making the function pointer a template arguments allows the compiler to inline the call instead of doing an runtime call by pointer. Also, optimize the allOf() case to avoid redundant kind checks. This speeds up our clang-tidy benchmark by ~2% Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6424 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223029 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
No functional changes, only code improvements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223010 91177308-0d34-0410-b5e6-96231b3b80d8
-
Arnaud A. de Grandmaison authored
Revert r222993 while I investigate some MemorySanitizer failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222995 91177308-0d34-0410-b5e6-96231b3b80d8
-
Arnaud A. de Grandmaison authored
Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222993 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 30, 2014
-
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222969 91177308-0d34-0410-b5e6-96231b3b80d8
-