]> granicus.if.org Git - clang/log
clang
9 years agoTry to fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:45:23 +0000 (17:45 +0000)]
Try to fix exceptions-seh-finally.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234614 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SEH] Re-land r234532, but use internal linkage for all SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 17:34:52 +0000 (17:34 +0000)]
[SEH] Re-land r234532, but use internal linkage for all SEH helpers

Even though these symbols are in a comdat group, the Microsoft linker
really wants them to have internal linkage.

I'm planning to tweak the mangling in a follow-up change. This is a
straight revert with a 1-line fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234613 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Frontend] Close open file handles before renaming output files
Reid Kleckner [Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)]
[Frontend] Close open file handles before renaming output files

The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234612 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't rely on implicit CallSite construction.
Benjamin Kramer [Fri, 10 Apr 2015 14:49:31 +0000 (14:49 +0000)]
Don't rely on implicit CallSite construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234600 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to make MSVC happy.
Rafael Espindola [Fri, 10 Apr 2015 14:37:39 +0000 (14:37 +0000)]
Try to make MSVC happy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234599 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReturn std::unique_ptr to avoid a release and recreate.
Rafael Espindola [Fri, 10 Apr 2015 14:30:43 +0000 (14:30 +0000)]
Return std::unique_ptr to avoid a release and recreate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234598 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse a std::unique_ptr to make it easier to see who owns the stream.
Rafael Espindola [Fri, 10 Apr 2015 14:11:52 +0000 (14:11 +0000)]
Use a std::unique_ptr to make it easier to see who owns the stream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234597 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 13:14:31 +0000 (13:14 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234592 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInitializing an uninitialized data member; should be NFC.
Aaron Ballman [Fri, 10 Apr 2015 13:05:04 +0000 (13:05 +0000)]
Initializing an uninitialized data member; should be NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234591 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 12:54:53 +0000 (12:54 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234590 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.
Benjamin Kramer [Fri, 10 Apr 2015 11:37:55 +0000 (11:37 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234587 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Alexey Bataev [Fri, 10 Apr 2015 10:43:45 +0000 (10:43 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

Differential Revision: http://reviews.llvm.org/D8915

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234583 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove threshold for inserting lifetime markers for named temporaries
Arnaud A. de Grandmaison [Fri, 10 Apr 2015 10:13:52 +0000 (10:13 +0000)]
Remove threshold for inserting lifetime markers for named temporaries

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.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234581 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReverting test commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:43:58 +0000 (08:43 +0000)]
Reverting test commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234578 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTest commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:42:08 +0000 (08:42 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234577 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Fixed cleanup of OpenMP code.
Alexey Bataev [Fri, 10 Apr 2015 07:48:12 +0000 (07:48 +0000)]
[OPENMP] Fixed cleanup of OpenMP code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234575 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo in test. There is no %clangcxx, but there is %clangxx.
Nick Lewycky [Fri, 10 Apr 2015 07:43:19 +0000 (07:43 +0000)]
Fix typo in test. There is no %clangcxx, but there is %clangxx.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234574 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Fixing troubles with lambdas in cleanups.
Alexey Bataev [Fri, 10 Apr 2015 06:33:45 +0000 (06:33 +0000)]
[OPENMP] Fixing troubles with lambdas in cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234572 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Fixed incompatibility with MSVC, NFC.
Alexey Bataev [Fri, 10 Apr 2015 05:32:31 +0000 (05:32 +0000)]
[OPENMP] Fixed incompatibility with MSVC, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234568 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Don't assume that an initializer list has an initializer
David Majnemer [Fri, 10 Apr 2015 04:52:06 +0000 (04:52 +0000)]
[Sema] Don't assume that an initializer list has an initializer

Given something like 'int({}, 1)', we would try to emit a diagnostic
regarding the excess element in the scalar initializer.  However, we
assumed that the initializer list had an element in it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234565 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Refactoring of codegen for OpenMP directives.
Alexey Bataev [Fri, 10 Apr 2015 04:50:10 +0000 (04:50 +0000)]
[OPENMP] Refactoring of codegen for OpenMP directives.

Refactored API of OpenMPRuntime for compatibility with combined directives.
Differential Revision: http://reviews.llvm.org/D8859

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234564 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r234532 for a bit, it very likely caused http://crbug.com/475768
Nico Weber [Fri, 10 Apr 2015 04:33:03 +0000 (04:33 +0000)]
Revert r234532 for a bit, it very likely caused http://crbug.com/475768

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234563 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.
Ekaterina Romanova [Fri, 10 Apr 2015 02:39:45 +0000 (02:39 +0000)]
_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234560 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Remove unused MACRO_TABLE record.
Richard Smith [Fri, 10 Apr 2015 02:02:24 +0000 (02:02 +0000)]
[modules] Remove unused MACRO_TABLE record.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234555 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd Clang support for remaining integer divide and permute instructions from ISA...
Nemanja Ivanovic [Thu, 9 Apr 2015 23:58:16 +0000 (23:58 +0000)]
Add Clang support for remaining integer divide and permute instructions from ISA 2.06

This patch corresponds to review:
http://reviews.llvm.org/D8398

It adds some builtin functions to access the extended divide and bit permute instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234547 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C Sema] It is permissable to bridge cast to 'id'
Fariborz Jahanian [Thu, 9 Apr 2015 23:39:53 +0000 (23:39 +0000)]
[Objective-C Sema] It is permissable to bridge cast to 'id'
of a CFType bridged to some unknown Objective-C type.
rdar://20113785

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234545 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate test case for r234543.
Benjamin Kramer [Thu, 9 Apr 2015 22:54:53 +0000 (22:54 +0000)]
Update test case for r234543.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234544 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Do a more principled fix for PR231653, always use the inner type.
Benjamin Kramer [Thu, 9 Apr 2015 22:50:07 +0000 (22:50 +0000)]
[CodeGen] Do a more principled fix for PR231653, always use the inner type.

We were still using the MaterializeTemporaryExpr's type to check if the
transform is legal. Always use the inner Expr type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234543 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPropagate usage of std:unique_ptr a bit. NFC.
Rafael Espindola [Thu, 9 Apr 2015 21:50:11 +0000 (21:50 +0000)]
Propagate usage of std:unique_ptr a bit. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234538 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate for LLVM api changes.
Rafael Espindola [Thu, 9 Apr 2015 21:06:11 +0000 (21:06 +0000)]
Update for LLVM api changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234536 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse Linux sysroot in Driver test case from r234521
Reid Kleckner [Thu, 9 Apr 2015 20:37:38 +0000 (20:37 +0000)]
Use Linux sysroot in Driver test case from r234521

We don't actually need a real Mac sysroot to make the test pass, just a
linker.  This makes the test pass in environments where no ld is on
PATH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234533 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SEH] Outline finally blocks using the new variable capture support
Reid Kleckner [Thu, 9 Apr 2015 20:37:24 +0000 (20:37 +0000)]
[SEH] Outline finally blocks using the new variable capture support

WinEHPrepare was going to have to pattern match the control flow merge
and split that the old lowering used, and that wasn't really feasible.

Now we can teach WinEHPrepare to pattern match this, which is much
simpler:
  %fp = call i8* @llvm.frameaddress(i32 0)
  call void @func(iN [01], i8* %fp)

This prototype happens to match the prototype used by the Win64 SEH
personality function, so this is really simple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234532 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Diagnose references to unbound arrays in function definitions
David Majnemer [Thu, 9 Apr 2015 19:53:25 +0000 (19:53 +0000)]
[Sema] Diagnose references to unbound arrays in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse on reference types while
looking for it, causing us to crash in CodeGen instead of rejecting it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234528 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoProperly implement warn_unused_result checking for classes/structs.
Kaelyn Takata [Thu, 9 Apr 2015 19:43:04 +0000 (19:43 +0000)]
Properly implement warn_unused_result checking for classes/structs.

The previous implementation would copy the attribute from the class to
functions that have the class as their return type when the functions
are first declared. This proved to have two flaws:
  1) if the class is forward-declared without the attribute and a
     function or method with the class as a its return type is declared,
     and afterward the class is defined with warn_unused_result, the
     function or method would never inherit the attribute, and
  2) the check simply failed for functions and methods that are part of
     a template instantiation, regardless of whether the class with
     warn_unused_result is part of a specific instantiation or part of
     the template itself (presumably because those function/method
     declaration does not hit the same code path as a non-template one
     and so never inherits the attribute).

The new approach is to instead modify the two places where a function or
method call is checked for the warn_unused_result attribute on the decl
by extending the checks to also look for the attribute on the decl's
return type.

Additionally, the check for return types that have the warn_unused_result
now excludes pointers and references to such types, as such return types do
not necessarily imply a transfer of ownership for the underlying object
being referred to by the return value. This does not change the behavior
of functions that are directly given the warn_unused_result attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234526 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ASan] Don't link against libc++abi when not using libc++
Hans Wennborg [Thu, 9 Apr 2015 18:47:01 +0000 (18:47 +0000)]
[ASan] Don't link against libc++abi when not using libc++

This is a follow-up to r233860 which added -lc++abi when using ASan
on Mac, and broke Chromium's ASan build which doesn't use libc++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234521 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C modern translation]. Patch to fix type of
Fariborz Jahanian [Thu, 9 Apr 2015 18:36:50 +0000 (18:36 +0000)]
[Objective-C modern translation]. Patch to fix type of
objc_msgSend's first argument to "Class" because
objc_getClass is passed. rdar://20477025

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234520 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdded flag to disable isel instruction on PPC target. Using regular branches instead...
Olivier Sallenave [Thu, 9 Apr 2015 17:38:50 +0000 (17:38 +0000)]
Added flag to disable isel instruction on PPC target. Using regular branches instead of isel is more efficient in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234509 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] When promoting a reference temporary to a global use the inner type to...
Benjamin Kramer [Thu, 9 Apr 2015 16:09:29 +0000 (16:09 +0000)]
[CodeGen] When promoting a reference temporary to a global use the inner type to fold it.

The MaterializeTemporaryExpr can have a different type than the inner
expression, miscompiling the constant. PR23165.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234499 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoProcess the -freciprocal-math optimization flag (PR20912)
Sanjay Patel [Thu, 9 Apr 2015 15:03:23 +0000 (15:03 +0000)]
Process the -freciprocal-math optimization flag (PR20912)

The driver currently accepts but ignores the -freciprocal-math flag.
This patch passes the flag through and enables 'arcp' fast-math-flag
generation in IR.

Note that this change does not actually enable the optimization for
any target. The reassociation optimization that this flag specifies
was implemented by http://reviews.llvm.org/D6334 :
http://llvm.org/viewvc/llvm-project?view=revision&revision=222510

Because the optimization is done in the backend rather than IR,
the backend must be modified to understand instruction-level
fast-math-flags or a new function-level attribute must be created.

Also note that -freciprocal-math is independent of any target-specific
usage of reciprocal estimate hardware instructions. That requires
its own flag ('-mrecip').

https://llvm.org/bugs/show_bug.cgi?id=20912

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234493 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] add support for Cortex-R4/R4F
Javed Absar [Thu, 9 Apr 2015 14:12:10 +0000 (14:12 +0000)]
[ARM] add support for Cortex-R4/R4F

Adds ARM Cortex-R4 and R4F support and tests in Clang. Though Cortex-R4
support was present, the support for hwdiv in thumb-mode was not defined
or tested properly. This has also been added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234488 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Support the /fp options (PR23112)
Hans Wennborg [Wed, 8 Apr 2015 22:55:09 +0000 (22:55 +0000)]
clang-cl: Support the /fp options (PR23112)

This hooks up the /fp options as aliases for -f[no-]fast-math and
-f[no]-trapping-math. It probably doesn't match cl.exe's behaviour
completely (e.g. LLVM is currently never as precise as /fp:precise),
but it's close enough.

Differential revision: http://reviews.llvm.org/D8909

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234449 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Don't wrap cleanups in terminate actions
Reid Kleckner [Wed, 8 Apr 2015 22:48:50 +0000 (22:48 +0000)]
[WinEH] Don't wrap cleanups in terminate actions

_CxxFrameHandler3 calls terminate if a cleanup action throws, regardless
of what bits you put in the xdata tables. There's no need to model this
in the IR, since we just have to take it out later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234448 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReland "[SEH] Implement filter capturing in CodeGen"
Reid Kleckner [Wed, 8 Apr 2015 22:23:48 +0000 (22:23 +0000)]
Reland "[SEH] Implement filter capturing in CodeGen"

The test should be fixed. It was failing in NDEBUG builds due to a
missing '*' character in a regex. In asserts builds, the pattern matched
a single digit value, which became a double digit value in NDEBUG
builds. Go figure.

This reverts commit r234261.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234447 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C Sema] Use canonical type of properties when comparing
Fariborz Jahanian [Wed, 8 Apr 2015 21:34:04 +0000 (21:34 +0000)]
[Objective-C Sema] Use canonical type of properties when comparing
redeclaration of property in class extension and to avoid
bogus error. rdar://20469452

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234440 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove redundant virtual on member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:01:55 +0000 (17:01 +0000)]
Remove redundant virtual on member functions marked 'override'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234417 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Allow redeclaration of variables as threadprivate.
Alexey Bataev [Wed, 8 Apr 2015 12:45:41 +0000 (12:45 +0000)]
[OPENMP] Allow redeclaration of variables as threadprivate.

No need to emit an error message if the variable is redeclared as threadprivate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234402 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAppease build bots that cannot find a viable conversion through CanQualType.
Aaron Ballman [Wed, 8 Apr 2015 00:13:33 +0000 (00:13 +0000)]
Appease build bots that cannot find a viable conversion through CanQualType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234376 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGenerate a diagnostic when a catch handler cannot execute due to class hierarchy...
Aaron Ballman [Wed, 8 Apr 2015 00:05:29 +0000 (00:05 +0000)]
Generate a diagnostic when a catch handler cannot execute due to class hierarchy inversion with regards to other catch handlers for the same block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234375 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the most recent previous decl to check if inline is added after a definition
Reid Kleckner [Wed, 8 Apr 2015 00:04:47 +0000 (00:04 +0000)]
Use the most recent previous decl to check if inline is added after a definition

This affects this test case:
  void foo();
  template <typename T> class C {
    friend inline void foo();
  };
  inline void foo() {}
  C<int> c;

Here, we instantiate the foo friend decl and add it to foo's redecl
chain. However, our previous decl pointer happens to reference the first
declaration of foo, which is not marked inline. When we check to see if
foo was already defined, we implicitly search all previous decls. We
should do the same for the inline check, instead of just checking this
particular previous decl.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D8872

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234374 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Correctly recurse when looking for [*] in function definitions
David Majnemer [Tue, 7 Apr 2015 22:08:51 +0000 (22:08 +0000)]
[Sema] Correctly recurse when looking for [*] in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse while looking for it, causing
us to crash in CodeGen instead of rejecting it.

This fixes PR23151.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234363 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Mark instantiated function decls as inline specified if any pattern is"
Reid Kleckner [Tue, 7 Apr 2015 20:46:51 +0000 (20:46 +0000)]
Revert "Mark instantiated function decls as inline specified if any pattern is"

It breaks down on this test case:
  void foo();
  template <typename T> class C {
    friend void foo();
  };
  inline void foo() {}
  C<int> c;

We shouldn't be marking the instantiation of the friend decl of foo as
inline-specified. It may be possible to fix this by determining if the
full definition is part of the current template, but it seems better to
rever tot green until we come up with a full solution.

This reverts commit r233817, as well as follow-ups r233820 and r233821.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234355 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Fix a compiler error under MSVC"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:41:26 +0000 (18:41 +0000)]
Revert "Fix a compiler error under MSVC"

This reverts the bandaid commit in r234308 now that I have a proper fix
in LLVM as of r234326.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234339 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo; NFC
Sanjay Patel [Tue, 7 Apr 2015 18:39:20 +0000 (18:39 +0000)]
fix typo; NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234338 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C Sema] Patch to not issue unavailbility/deprecated
Fariborz Jahanian [Tue, 7 Apr 2015 16:56:27 +0000 (16:56 +0000)]
[Objective-C Sema] Patch to not issue unavailbility/deprecated
warning when multiple method declarations are found in global pool
with differing types and some are available.
rdar://20408445

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234328 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: LLVM API change in r234326 for array-like tuple wrappers
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 16:50:49 +0000 (16:50 +0000)]
DebugInfo: LLVM API change in r234326 for array-like tuple wrappers

Update a few calls to `DIBuilder` now that `MDTuple` array-wrappers
don't have implicit conversions to `MDTuple*`.  I may circle back and
update `DIBuilder` to take arrays here, to make it easier for the
callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234327 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix regression formatting QT's "signals:" from r234318.
Daniel Jasper [Tue, 7 Apr 2015 15:04:40 +0000 (15:04 +0000)]
clang-format: Fix regression formatting QT's "signals:" from r234318.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234320 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Don't allow labels when expecting declarations.
Daniel Jasper [Tue, 7 Apr 2015 14:36:33 +0000 (14:36 +0000)]
clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
  struct MyStruct {
    uchar data;
  uchar:
    8;
  uchar:
    8;
    uchar other;
  };

After:
  struct MyStruct {
    uchar data;
    uchar : 8;
    uchar : 8;
    uchar other;
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234318 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a compiler error under MSVC
Timur Iskhodzhanov [Tue, 7 Apr 2015 11:26:00 +0000 (11:26 +0000)]
Fix a compiler error under MSVC

Error message was:
CGDebugInfo.cpp(1047) : error C2666: 'llvm::MDTypeRefArray::operator []' : 2 overloads have similar conversions
  DebugInfoMetadata.h(106): could be 'llvm::MDTypeRef llvm::MDTypeRefArray::operator [](unsigned int) const'
  while trying to match the argument list '(llvm::DITypeArray, int)'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234308 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[SEH] Implement filter capturing in CodeGen"
Daniel Jasper [Tue, 7 Apr 2015 10:07:47 +0000 (10:07 +0000)]
Revert "[SEH] Implement filter capturing in CodeGen"

Test fails:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/3182/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234306 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Improve nested block formatting.
Daniel Jasper [Tue, 7 Apr 2015 08:20:35 +0000 (08:20 +0000)]
clang-format: Improve nested block formatting.

Before:
  functionA(functionB({
    int i;
    int j;
  }),
            aaaa, bbbb, cccc);

After:
  functionA(functionB({
              int i;
              int j;
            }),
            aaaa, bbbb, cccc);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234304 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Indent relative to the ./-> and not the function name.
Daniel Jasper [Tue, 7 Apr 2015 06:41:24 +0000 (06:41 +0000)]
clang-format: Indent relative to the ./-> and not the function name.

Before:
  aaaaaaaaaaa     //
      .aaaa(      //
           bbbb)  // This is different ..
      .aaaa(      //
          cccc);  // .. from this.

After:
  aaaaaaaaaaa     //
      .aaaa(      //
          bbbb)   // This is identical ..
      .aaaa(      //
          cccc);  // .. to this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234300 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks
David Majnemer [Tue, 7 Apr 2015 06:01:53 +0000 (06:01 +0000)]
[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks

A simple case of asserting isFunctionOrMethod when we should have
asserted isFunctionOrMethodOrBlock.

This fixes PR23117.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234297 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Update for LLVM change in r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:45 +0000 (04:14 +0000)]
DebugInfo: Update for LLVM change in r234290

The API for `DIArray` changed; use the new one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234291 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Don't permit dependent alignments on non-dependent typedef-names
David Majnemer [Tue, 7 Apr 2015 02:37:09 +0000 (02:37 +0000)]
[Sema] Don't permit dependent alignments on non-dependent typedef-names

A dependent alignment attribute (like __attribute__((aligned(...))) or
__declspec(align(...))) on a non-dependent typedef or using declaration
poses a considerable challenge: the type is _not_ dependent, the size
_may_ be dependent if the type is used as an array type, the alignment
_is_ dependent.

It is reasonable for a compiler to be able to query the size and
alignment of a complete type.  Let's help that become an invariant.

This fixes PR22042.

Differential Revision: http://reviews.llvm.org/D8693

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234280 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReport an error when -m<os>-version-min= does not specify a version.
Bob Wilson [Tue, 7 Apr 2015 01:03:35 +0000 (01:03 +0000)]
Report an error when -m<os>-version-min= does not specify a version.

Currently if you use -mmacosx-version-min or -mios-version-min without
specifying a version number, clang silently sets the minimum version to
"0.0.0". This is almost certainly not what was intended, so it is better
to report it as an error. rdar://problem/20433945

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234270 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Don't create an alloca for unnamed catch parameters
Reid Kleckner [Tue, 7 Apr 2015 00:09:59 +0000 (00:09 +0000)]
[WinEH] Don't create an alloca for unnamed catch parameters

The catch object parameter to llvm.eh.begincatch is optional, and can be
null. We can save some ourselves the stack space, copy ctor, and dtor
calls if we pass null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234264 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SEH] Implement filter capturing in CodeGen
Reid Kleckner [Mon, 6 Apr 2015 23:51:44 +0000 (23:51 +0000)]
[SEH] Implement filter capturing in CodeGen

While capturing filters aren't very common, we'd like to outline
__finally blocks in the frontend to simplify -O0 EH preparation and
reduce code size. Finally blocks are usually have captures, and this is
the first step towards that.

Currently we don't support capturing 'this' or VLAs.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D8825

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234261 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCGDebugInfo: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:21:33 +0000 (23:21 +0000)]
CGDebugInfo: Stop using DIDescriptor::is*() and auto-casting

The clang edition of r234255: use built-in `isa<>`, `dyn_cast<>`, etc.,
and only build `DIDescriptor`s from pointers that are correctly typed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234256 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Use DILexicalBlockFile::getContext() over getScope()
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:04:18 +0000 (22:04 +0000)]
DebugInfo: Use DILexicalBlockFile::getContext() over getScope()

`getScope()` passes the scope back through a `DILexicalBlock` even
though the underlying pointer may be an incompatible `MDSubprogram`.
Just use `getContext()` directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234245 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a call to std::unique to actually discard the trailing (junk) elements.
James Dennett [Mon, 6 Apr 2015 21:09:24 +0000 (21:09 +0000)]
Fix a call to std::unique to actually discard the trailing (junk) elements.

Found by inspection.  (No other instances of this problem were found.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234221 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMSan told me that we actually dump the entire scratch buffer into PCH files, initiali...
Benjamin Kramer [Mon, 6 Apr 2015 20:01:49 +0000 (20:01 +0000)]
MSan told me that we actually dump the entire scratch buffer into PCH files, initialize it.

Writing 4k of zeros is preferrable to 4k of random memory. Document that. While
there remove the initialization of the first byte of the buffer and start at
index zero. It was writing a literal '0' instead of a null byte at the
beginning anyways, which didn't matter since we never read it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234202 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPrefer uninitialized memory for scratch space.
Benjamin Kramer [Mon, 6 Apr 2015 17:45:11 +0000 (17:45 +0000)]
Prefer uninitialized memory for scratch space.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234184 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C patch] Patch to fix a crash in IRGen because
Fariborz Jahanian [Mon, 6 Apr 2015 16:56:39 +0000 (16:56 +0000)]
[Objective-C patch] Patch to fix a crash in IRGen because
of incorrect AST when a compound literal of Objective-C
property access is used to initialize a vertor of floats.
rdar://20407999

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234176 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix this test so it doesn't try to open a file to write to the source tree
David Blaikie [Mon, 6 Apr 2015 16:33:18 +0000 (16:33 +0000)]
Fix this test so it doesn't try to open a file to write to the source tree

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234173 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGating clang-fuzzer on the same conditions required to build the LLVMFuzzer library...
Aaron Ballman [Mon, 6 Apr 2015 16:10:32 +0000 (16:10 +0000)]
Gating clang-fuzzer on the same conditions required to build the LLVMFuzzer library. Otherwise, we can run into a situation where clang-fuzzer attempts to build, but its dependency was never built.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234170 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHasSideEffects() should return false for calls to pure and const functions.
Michael Kuperstein [Mon, 6 Apr 2015 13:22:01 +0000 (13:22 +0000)]
HasSideEffects() should return false for calls to pure and const functions.

Differential Revision: http://reviews.llvm.org/D8548

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234152 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate our list of distros a bit.
Benjamin Kramer [Mon, 6 Apr 2015 12:30:43 +0000 (12:30 +0000)]
Update our list of distros a bit.

- Debian jessie will be released this month, add the next testing version to the list.
- RHEL7 was released last june.
- Ubuntu utopic was released last october, vivid will follow later this month.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234149 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/Profile/profile-does-not-exist.c: Avoid checking a message line in the...
NAKAMURA Takumi [Mon, 6 Apr 2015 08:16:36 +0000 (08:16 +0000)]
clang/test/Profile/profile-does-not-exist.c: Avoid checking a message line in the message catalog.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234146 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis reverts commit r234104, bringing back 233393 now that ARM is fixed.
Rafael Espindola [Mon, 6 Apr 2015 04:36:45 +0000 (04:36 +0000)]
This reverts commit r234104, bringing back  233393 now that ARM is fixed.

Original message:

Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234143 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't crash when passing a non-existent file to -fprofile-instr-use=.
Nico Weber [Mon, 6 Apr 2015 04:16:48 +0000 (04:16 +0000)]
Don't crash when passing a non-existent file to -fprofile-instr-use=.

Fixes a regression from r229434.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234141 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format my last commit
David Blaikie [Sun, 5 Apr 2015 22:47:07 +0000 (22:47 +0000)]
clang-format my last commit

(sorry, keep forgetting that)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234129 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sun, 5 Apr 2015 22:45:47 +0000 (22:45 +0000)]
[opaque pointer type] More GEP API migrations

Looks like the VTable code in particular will need some work to pass
around the pointee type explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234128 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace copy loop with std::copy.
Benjamin Kramer [Sun, 5 Apr 2015 18:55:02 +0000 (18:55 +0000)]
Replace copy loop with std::copy.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234123 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSwitch test from wchar_t to char32_t
David Majnemer [Sun, 5 Apr 2015 05:42:02 +0000 (05:42 +0000)]
Switch test from wchar_t to char32_t

Windows has a 16-bit wchar_t, most Unix platforms have a 32-bit wchar_t.
Use a char32_t to keep the test's output stable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234111 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AST] String literal operator templates have two template args, not one
David Majnemer [Sun, 5 Apr 2015 05:32:54 +0000 (05:32 +0000)]
[AST] String literal operator templates have two template args, not one

StmtPrinter assumed that the first template arg was the pack and
attempted to iterate it.  However, the GNU extension (which is really
just N3599), has two template arguments.  In this case, the second
argument is the pack containing the string contents.

Handle this by desugaring the call to the explicit operator.

For example:
"qux" _zombocom will be shown as
operator "" _zombocom<char, 'q', 'u', 'x'>() in diagnostics and AST
dumps.

N.B.  It is actually impossible to render the arguments back to the
source form without storing more information in the AST.  For example,
we cannot tell if the user wrote u8"qux" or "qux".  We also lose
fidelity when it comes to non-char types for this exact reason (e.g. it
is hard to render a list of wchar_t back to something that can be
printed to the screen even if you don't have to consider surrogate
pairs).

This fixes PR23120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234110 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sat, 4 Apr 2015 21:07:17 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234109 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Revert "Revert "Don't use unique section names by default if using the integr...
Rafael Espindola [Sat, 4 Apr 2015 19:32:41 +0000 (19:32 +0000)]
Revert "Revert "Revert "Don't use unique section names by default if using the integrated as."""

This reverts commit r234101. I will debug what went wrong with ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234104 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Revert "Don't use unique section names by default if using the integrated...
Rafael Espindola [Sat, 4 Apr 2015 18:21:14 +0000 (18:21 +0000)]
Revert "Revert "Don't use unique section names by default if using the integrated as.""

This reverts commit r233398, bringing back 233393 now that LLVM is fixed.

Original message:

Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234101 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] more GEP API migrations
David Blaikie [Sat, 4 Apr 2015 15:12:29 +0000 (15:12 +0000)]
[opaque pointer type] more GEP API migrations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234097 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove the cl-no-signed-zeros cc1 option
Sanjay Patel [Sat, 4 Apr 2015 14:54:24 +0000 (14:54 +0000)]
Remove the cl-no-signed-zeros cc1 option

Use the driver flag -fno-signed-zeros instead.

This was recommended but not implemented in D6873:
http://reviews.llvm.org/D6873

which was checked in at r226915:
http://reviews.llvm.org/rL226915

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234093 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Understand object literals with only methods.
Daniel Jasper [Sat, 4 Apr 2015 07:56:55 +0000 (07:56 +0000)]
clang-format: [JS] Understand object literals with only methods.

Before:
  let theObject = {someMethodName() {
    doTheThing();
    doTheOtherThing();
  },
                   someOtherMethodName() {
                     doSomething();
                     doSomethingElse();
                   }};

After:
  let theObject = {
    someMethodName() {
      doTheThing();
      doTheOtherThing();
    },
    someOtherMethodName() {
      doSomething();
      doSomethingElse();
    }
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234091 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void
David Majnemer [Sat, 4 Apr 2015 05:37:48 +0000 (05:37 +0000)]
[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void

Don't assume that all pointers are convertible to void pointer.
Instead correctly respect [conv.ptr]p2; only allow pointer types with an
object pointee type to be caught as pointer-to-void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234090 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoComplete comment. Reflow conditional.
Eric Christopher [Sat, 4 Apr 2015 03:34:43 +0000 (03:34 +0000)]
Complete comment. Reflow conditional.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234083 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Explicitly specify some types for GEP
David Blaikie [Fri, 3 Apr 2015 22:54:16 +0000 (22:54 +0000)]
[opaque pointer type] Explicitly specify some types for GEP

Not all of them (there's still a fallback for this specific function
that omits the type parameter) but it's some I bothered to do now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234063 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Proto] No alternate operator names.
Daniel Jasper [Fri, 3 Apr 2015 21:15:46 +0000 (21:15 +0000)]
clang-format: [Proto] No alternate operator names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234055 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[i386 ABI] expand small C like structs in C++, just like how we handle small
Manman Ren [Fri, 3 Apr 2015 18:10:29 +0000 (18:10 +0000)]
[i386 ABI] expand small C like structs in C++, just like how we handle small
C structs.

This comes up when we have a function that takes a struct and is defined in a
C++ file and used in a C file.

Before this commit, we will generate byval for C++ and will expand the struct
for C, thus causing difference at IR level. We will use bitcast of function type
at the callsite, which causes the inliner to not inline the function.

This commit changes how we handle small C like structs at IR level, but at
backend, we should generate the same argument passing before and after the
commit.

Note that the condition for expanding is still over conservative. We should be
able to expand type that is spelled with “class” and types that are not C-like.
But this commit fixes the inconsistent argument passing between C/C++.

Reviewed by John.

rdar://20121030

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234033 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Explicitly specify type to CreateGEP
David Blaikie [Fri, 3 Apr 2015 17:47:16 +0000 (17:47 +0000)]
[opaque pointer type] Explicitly specify type to CreateGEP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234032 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test not rely on a backend being registered.
Eric Christopher [Fri, 3 Apr 2015 01:27:02 +0000 (01:27 +0000)]
Make this test not rely on a backend being registered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233993 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdded support for attributed types to the ASTImporter.
Sean Callanan [Thu, 2 Apr 2015 23:50:08 +0000 (23:50 +0000)]
Added support for attributed types to the ASTImporter.

<rdar://problem/20403544>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233985 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a question mark to the end of an interrogatory warning.
Eric Christopher [Thu, 2 Apr 2015 22:30:23 +0000 (22:30 +0000)]
Add a question mark to the end of an interrogatory warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233982 91177308-0d34-0410-b5e6-96231b3b80d8