]> granicus.if.org Git - clang/log
clang
10 years agoMissed a ! in the if statement when these were being set and the options
Eric Christopher [Fri, 16 May 2014 20:46:14 +0000 (20:46 +0000)]
Missed a ! in the if statement when these were being set and the options
are inverted in clang and llvm.

I'll attempt to get a testcase for this that doesn't involve compiling to .s,
but it's unlikely.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 16 May 2014 19:35:48 +0000 (19:35 +0000)]
Update for llvm api change.

Now that llvm cannot represent alias cycles, we have to diagnose erros just
before trying to close the cycle. This degrades the errors a bit. The real
solution is what it was before: if we want to provide good errors for these
cases, we have to be able to find a clang level decl given a mangled name
and produce the error from Sema.

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

10 years ago[ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.
Joey Gouly [Fri, 16 May 2014 19:31:08 +0000 (19:31 +0000)]
[ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.

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

10 years agoMerge a couple of copy-and-pasted functions
Alp Toker [Fri, 16 May 2014 18:59:21 +0000 (18:59 +0000)]
Merge a couple of copy-and-pasted functions

No change in functionality.

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

10 years agoRename SourceManager::createFileIDForMemBuffer()
Alp Toker [Fri, 16 May 2014 17:23:01 +0000 (17:23 +0000)]
Rename SourceManager::createFileIDForMemBuffer()

It makes more sense to just overload createFileID().

Gardening only.

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

10 years agoTooling: use stderr, not stdout for missing command line messages
Alp Toker [Fri, 16 May 2014 13:45:29 +0000 (13:45 +0000)]
Tooling: use stderr, not stdout for missing command line messages

Matches other tooling output that use stderr.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Fri, 16 May 2014 13:34:28 +0000 (13:34 +0000)]
Update for llvm API change.

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

10 years agoImprove a scan-build message
Sylvestre Ledru [Fri, 16 May 2014 07:03:15 +0000 (07:03 +0000)]
Improve a scan-build message

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

10 years agoInstrProf: Look for the PIC-version of the profile runtime
Duncan P. N. Exon Smith [Fri, 16 May 2014 04:09:41 +0000 (04:09 +0000)]
InstrProf: Look for the PIC-version of the profile runtime

If `-shared` is specified, pull in a PIC-version of the profile runtime,
which was added to compiler-rt in r208947.  I'm hoping this will get the
bots on my side.

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

10 years agoPush implicitly-declared allocation functions into the IdResolver. Otherwise,
Richard Smith [Fri, 16 May 2014 02:14:42 +0000 (02:14 +0000)]
Push implicitly-declared allocation functions into the IdResolver. Otherwise,
declaration merging in modules is unable to find them and we get bogus errors
and even crashes.

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

10 years agoReplace a fake enum class with the real thing.
Richard Smith [Fri, 16 May 2014 01:56:53 +0000 (01:56 +0000)]
Replace a fake enum class with the real thing.

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

10 years agoSwitch another write_escaped to yaml::escape
Ben Langmuir [Fri, 16 May 2014 01:38:59 +0000 (01:38 +0000)]
Switch another write_escaped to yaml::escape

I missed one in r206443.

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

10 years agoInstrProf: Set profile data to visibility hidden
Duncan P. N. Exon Smith [Fri, 16 May 2014 01:24:00 +0000 (01:24 +0000)]
InstrProf: Set profile data to visibility hidden

Shared objects are fairly broken for InstrProf right now -- a follow-up
commit in compiler-rt will fix the rest of this.

The main problem here is that at link time, profile data symbols in the
shared object might get used instead of symbols from the main
executable, creating invalid profile data sections.

<rdar://problem/16918688>

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

10 years agotest/CodeGenCXX/dllexport.cpp: we already correctly emit b() even when
Hans Wennborg [Fri, 16 May 2014 00:09:31 +0000 (00:09 +0000)]
test/CodeGenCXX/dllexport.cpp: we already correctly emit b() even when
it's not used, because CodeGenModule::EmitGlobal consults
ASTContext::DeclMustBeEmitted via CodeGenModule::MayDeferGeneration.

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

10 years agoMS ABI: Use musttail for thunk IR generation
Reid Kleckner [Thu, 15 May 2014 23:01:46 +0000 (23:01 +0000)]
MS ABI: Use musttail for thunk IR generation

This allows us to perfectly forward non-trivial arguments that use
inalloca.

We still can't forward non-trivial arguments through thunks when we have
a covariant return type with a non-trivial adjustment.  This would
require emitting an extra copy, which is non-conforming anyway.

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

10 years agoEliminate DefaultImageName from the Driver constructor
Alp Toker [Thu, 15 May 2014 22:26:36 +0000 (22:26 +0000)]
Eliminate DefaultImageName from the Driver constructor

All callers were passing in "a.out" or garbage so a sensible default works fine
here as a cleanup.

This also brings about the possibility of adapting the value based on the
driver's compatibility mode in future.

The setting can still be changed via Driver::DefaultImageName as needed.

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

10 years agoAllow dllimport/dllexport on inline functions and adjust the linkage.
Hans Wennborg [Thu, 15 May 2014 22:07:49 +0000 (22:07 +0000)]
Allow dllimport/dllexport on inline functions and adjust the linkage.

This is a step towards handling these attributes on classes (PR11170).

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

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

10 years agoThread Safety Analysis: fixes to SExpr pretty printing.
DeLesley Hutchins [Thu, 15 May 2014 22:07:41 +0000 (22:07 +0000)]
Thread Safety Analysis: fixes to SExpr pretty printing.

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

10 years agoRefactoring another for loop to use a range-based for loop instead. Also cleaned...
Aaron Ballman [Thu, 15 May 2014 20:58:55 +0000 (20:58 +0000)]
Refactoring another for loop to use a range-based for loop instead. Also cleaned up a bit of formatting. No functional changes intended.

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

10 years agoRefactoring some for loops to use range-based for loops instead. No functional change...
Aaron Ballman [Thu, 15 May 2014 20:50:47 +0000 (20:50 +0000)]
Refactoring some for loops to use range-based for loops instead. No functional changes intended.

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

10 years agoUse the virtual name of headers when searching for a module
Ben Langmuir [Thu, 15 May 2014 16:20:33 +0000 (16:20 +0000)]
Use the virtual name of headers when searching for a module

When using the VFS, we want the virtual header location when searching
for a framework module, since that will be the one in the correct
directory structure for the module.

I'll add a regression test once I finish reducing the larger one I have.

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

10 years agoclang-format: Fix Sphinx build error.
Daniel Jasper [Thu, 15 May 2014 13:55:19 +0000 (13:55 +0000)]
clang-format: Fix Sphinx build error.

Patch by Adam Strzelecki, thank you!

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

10 years agoC++11 - Use nullptr in lib/Sema/SemaOpenMP.cpp and some reformatting (no functional...
Alexander Musman [Thu, 15 May 2014 13:04:49 +0000 (13:04 +0000)]
C++11 - Use nullptr in lib/Sema/SemaOpenMP.cpp and some reformatting (no functional changes).

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

10 years agoARM64: update tests now that we print "mov" & "mvn".
Tim Northover [Thu, 15 May 2014 12:11:10 +0000 (12:11 +0000)]
ARM64: update tests now that we print "mov" & "mvn".

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

10 years agoAArch64: update test after LLVM CodeGen change
Tim Northover [Thu, 15 May 2014 11:21:39 +0000 (11:21 +0000)]
AArch64: update test after LLVM CodeGen change

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

10 years agoAST: Remove dead-code/update reference to standard
David Majnemer [Thu, 15 May 2014 06:25:57 +0000 (06:25 +0000)]
AST: Remove dead-code/update reference to standard

GetGVALinkageForFunction handles TSK_ExplicitInstantiationDeclaration
twice, remove the redundant code trying to handle it again.

While we are here, update the reference we make to the standard.  It
seems like another paragraph was added causing this text to get
renumbered.

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

10 years ago[libclang] Introduce clang_Module_isSystem(), which returns non-zero if the given...
Argyrios Kyrtzidis [Thu, 15 May 2014 04:44:25 +0000 (04:44 +0000)]
[libclang] Introduce clang_Module_isSystem(), which returns non-zero if the given CXModule is a system one.

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

10 years agoReplace completely bogus ambiguous-compound-literal-in-C++ code with something
Richard Smith [Thu, 15 May 2014 02:51:15 +0000 (02:51 +0000)]
Replace completely bogus ambiguous-compound-literal-in-C++ code with something
that isn't always wrong.

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

10 years agoPR19748: Make sure we don't lose colon protection after the parenthesized type-id...
Richard Smith [Thu, 15 May 2014 02:43:47 +0000 (02:43 +0000)]
PR19748: Make sure we don't lose colon protection after the parenthesized type-id in a cast-expression.

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

10 years agoFix typos
Alp Toker [Thu, 15 May 2014 01:35:53 +0000 (01:35 +0000)]
Fix typos

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

10 years agoRevert Itanium parts of "Don't copy objects with trivial, deleted copy ctors"
Reid Kleckner [Thu, 15 May 2014 01:26:32 +0000 (01:26 +0000)]
Revert Itanium parts of "Don't copy objects with trivial, deleted copy ctors"

This undoes half of r208786.

It had problems with lazily declared special members in cases like this:
  struct A {
    A();
    A &operator=(A &&o);
    void *p;
  };
  void foo(A);
  void bar() {
    foo({});
  }

In this case, the copy and move constructors are implicitly deleted.
However, Clang doesn't eagerly declare the copy ctor in the AST, so we
pass the struct in registers.  Furthermore, GCC passes this in registers
even though this class should be uncopyable.

Revert this for now until the dust settles.

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

10 years agoFill in the options in the MCOptions struct directly like the other
Eric Christopher [Thu, 15 May 2014 01:21:56 +0000 (01:21 +0000)]
Fill in the options in the MCOptions struct directly like the other
options.

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

10 years agoThread Safety Analysis: add new node types to thread safety TIL.
DeLesley Hutchins [Thu, 15 May 2014 00:50:36 +0000 (00:50 +0000)]
Thread Safety Analysis: add new node types to thread safety TIL.
This fills in a few missing gaps in functionality.

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

10 years agoPR19742: cv-qualifiers and ref-qualifiers aren't allowed on functions within
Richard Smith [Wed, 14 May 2014 23:23:27 +0000 (23:23 +0000)]
PR19742: cv-qualifiers and ref-qualifiers aren't allowed on functions within
pointer and reference types, even if those types are produced by template
instantiation.

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

10 years agoWhen an overloaded comparison operator returns a reference, do not consider
Richard Trieu [Wed, 14 May 2014 23:22:10 +0000 (23:22 +0000)]
When an overloaded comparison operator returns a reference, do not consider
it for -Wunused-comparion warnings.  This fixes PR19724.

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

10 years ago[liblang] Introduce clang_getModuleForFile, which given a CXFile header file, returns...
Argyrios Kyrtzidis [Wed, 14 May 2014 23:14:37 +0000 (23:14 +0000)]
[liblang] Introduce clang_getModuleForFile, which given a CXFile header file, returns the module that contains it, if one exists.

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

10 years agoMake verbose clang builds also build compiler_rt verbosely
Jonathan Roelofs [Wed, 14 May 2014 23:07:16 +0000 (23:07 +0000)]
Make verbose clang builds also build compiler_rt verbosely

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

10 years agoConverting some for loops to use range-based for loops. No functional changes intended.
Aaron Ballman [Wed, 14 May 2014 20:42:13 +0000 (20:42 +0000)]
Converting some for loops to use range-based for loops. No functional changes intended.

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

10 years agoRename CodeGenModule::getLLVMLinkageforDeclarator -> getLLVMLinkageForDeclarator
Hans Wennborg [Wed, 14 May 2014 19:54:53 +0000 (19:54 +0000)]
Rename CodeGenModule::getLLVMLinkageforDeclarator -> getLLVMLinkageForDeclarator

No functionality change.

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

10 years agoAmending r208783 based on a suggestion by David Blaikie.
Aaron Ballman [Wed, 14 May 2014 18:32:59 +0000 (18:32 +0000)]
Amending r208783 based on a suggestion by David Blaikie.

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

10 years agoWhen we generate a redeclaration for an
John McCall [Wed, 14 May 2014 18:31:48 +0000 (18:31 +0000)]
When we generate a redeclaration for an
elaborated-type-specifier, place it in the correct
context.

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

10 years agoclang-cl: Fall back immediately if /GR and /fallback were both passed
Reid Kleckner [Wed, 14 May 2014 16:03:05 +0000 (16:03 +0000)]
clang-cl: Fall back immediately if /GR and /fallback were both passed

None of our tests use /fallback, so this lets us gradually add RTTI
support without breaking projects using /fallback.

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

10 years agoDon't copy objects with trivial, deleted copy ctors
Reid Kleckner [Wed, 14 May 2014 16:02:09 +0000 (16:02 +0000)]
Don't copy objects with trivial, deleted copy ctors

This affects both the Itanium and Microsoft C++ ABIs.

This is in anticipation of a change to the Itanium C++ ABI, and should
match GCC's current behavior.  The new text will likely be:

"""
Pass an object of class type by value if every copy constructor and
move constructor is deleted or trivial and at least one of them is not
deleted, and the destructor is trivial.
"""
http://sourcerytools.com/pipermail/cxx-abi-dev/2014-May/002728.html

On x86 Windows, we can mostly use the same logic, where we use inalloca
instead of passing by address.  However, on Win64, there are register
parameters, and we have to do what MSVC does.  MSVC ignores the presence
of non-trivial move constructors and only considers the presence of
non-trivial or deleted copy constructors.  If a non-trivial or deleted
copy ctor is present, it passes the argument indirectly.

This change fixes bugs and makes us more ABI compatible with both GCC
and MSVC.

Fixes PR19668.

Reviewers: rsmith

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

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

10 years agoReplacing some manual iterations with standard algorithms. No functional changes...
Aaron Ballman [Wed, 14 May 2014 15:01:43 +0000 (15:01 +0000)]
Replacing some manual iterations with standard algorithms. No functional changes intended.

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

10 years agoFormatting and style changes; no functional changes intended.
Aaron Ballman [Wed, 14 May 2014 13:03:55 +0000 (13:03 +0000)]
Formatting and style changes; no functional changes intended.

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

10 years agoRemove empty directory left after r207995.
Alexander Kornienko [Wed, 14 May 2014 11:34:48 +0000 (11:34 +0000)]
Remove empty directory left after r207995.

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

10 years ago[OPENMP] Fix warning in Release builds.
Alexey Bataev [Wed, 14 May 2014 10:40:54 +0000 (10:40 +0000)]
[OPENMP] Fix warning in Release builds.

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

10 years agoclang-format: Add clang-format-diff usage examples for SVN.
Daniel Jasper [Wed, 14 May 2014 09:36:11 +0000 (09:36 +0000)]
clang-format: Add clang-format-diff usage examples for SVN.

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

10 years agoclang-format: Add option to allow short blocks on a single line.
Daniel Jasper [Wed, 14 May 2014 09:33:35 +0000 (09:33 +0000)]
clang-format: Add option to allow short blocks on a single line.

With AllowShortBlocksOnASingleLine, clang-format allows:
  if (a) { return; }

Based on patch by Gonzalo BG, thank you!

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

10 years ago[ARM64]Fix the bug right shift uint64_t by 64 generates incorrect result.
Hao Liu [Wed, 14 May 2014 08:59:30 +0000 (08:59 +0000)]
[ARM64]Fix the bug right shift uint64_t by 64 generates incorrect result.

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

10 years agoSema::FindAllocationFunctions(): Fix \param. [-Wdocumentation]
NAKAMURA Takumi [Wed, 14 May 2014 08:07:56 +0000 (08:07 +0000)]
Sema::FindAllocationFunctions(): Fix \param. [-Wdocumentation]

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

10 years agoCreate a redeclaration when an elaborated type specifier
John McCall [Wed, 14 May 2014 07:54:17 +0000 (07:54 +0000)]
Create a redeclaration when an elaborated type specifier
resolves to an existing declaration if there are attributes
present.

This gives us something to apply the attributes to.

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

10 years agoDebugInfo: Avoid creating DILexicalScopeFiles when the filename in the current scope...
David Blaikie [Wed, 14 May 2014 00:29:00 +0000 (00:29 +0000)]
DebugInfo: Avoid creating DILexicalScopeFiles when the filename in the current scope has not changed.

This looks like the right way for this check to work, but there is
another semi-obvious bug, I would think: why is CurLoc not zero'd out
between functions? The possibility for it to bleed between them seems
problematic. (& indeed I caused tests to fail when I fixed this a
different way, by setting CurLoc to SourceLocation() and the end of
EmitFunctionEnd... )

The changes to debug-info-blocks.m are due to a mismatch between the
source manager's file naming and CGDebugInfo's default handling when no
-main-file-name is specified. This actually reveals somewhat of a bug in
the debug info when using source files from standard in, too. See the
comment in CGDebugInfo::CreateCompileUnit for more details.

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

10 years agoPush record return type classification into CGCXXABI
Reid Kleckner [Tue, 13 May 2014 22:05:45 +0000 (22:05 +0000)]
Push record return type classification into CGCXXABI

In the Microsoft C++ ABI, instance methods always return records
indirectly via the second hidden parameter.  This was implemented in
X86_32ABIInfo, but not WinX86_64ABIInfo.

Rather than exposing a handful of boolean methods in the CGCXXABI
interface, we can expose a single method that applies C++ ABI return
value classification rules.

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

10 years agoMake this test target independent.
Eric Christopher [Tue, 13 May 2014 20:16:43 +0000 (20:16 +0000)]
Make this test target independent.

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

10 years agoPR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. This
Richard Smith [Tue, 13 May 2014 19:56:21 +0000 (19:56 +0000)]
PR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. This
caused us to perform copy-initialization for the parameters of an allocation
function called by a new-expression multiple times, resulting in us rejecting
allocations that passed non-copyable parameters (and much worse things in
MSVC compat mode, where we potentially called this function multiple times).

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

10 years agoAdd a requires for the arm-registered-target needed by this test as
Eric Christopher [Tue, 13 May 2014 19:52:18 +0000 (19:52 +0000)]
Add a requires for the arm-registered-target needed by this test as
well.

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

10 years agoAdd __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind
Joerg Sonnenberger [Tue, 13 May 2014 18:58:36 +0000 (18:58 +0000)]
Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind
instructions.

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

10 years agoTest preprocessor defines for NetBSD/ARM.
Joerg Sonnenberger [Tue, 13 May 2014 18:58:00 +0000 (18:58 +0000)]
Test preprocessor defines for NetBSD/ARM.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 13 May 2014 18:45:53 +0000 (18:45 +0000)]
Update for llvm API change.

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

10 years agoFix the AST printer for attributed statements so that it does not print duplicate...
Aaron Ballman [Tue, 13 May 2014 16:12:14 +0000 (16:12 +0000)]
Fix the AST printer for attributed statements so that it does not print duplicate attribute introducers. Eg) [[clang::fallthrough]] instead of  [[[[clang::fallthrough]]]]

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

10 years agoUpdated the test case to show that no diagnostics are expected, and not require emitt...
Aaron Ballman [Tue, 13 May 2014 15:14:59 +0000 (15:14 +0000)]
Updated the test case to show that no diagnostics are expected, and not require emitting the AST until after the AST printing for statement attributes is updated.

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

10 years agoNo longer triggering a checked iterator assert on Windows when using std::copy while...
Aaron Ballman [Tue, 13 May 2014 14:55:01 +0000 (14:55 +0000)]
No longer triggering a checked iterator assert on Windows when using std::copy while deserializing attributed statements with more than one attribute.

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

10 years agoDefine the InterlockedCompareExchange64 intrinsic on 32-bits too
Timur Iskhodzhanov [Tue, 13 May 2014 13:59:05 +0000 (13:59 +0000)]
Define the InterlockedCompareExchange64 intrinsic on 32-bits too

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

10 years agotry to make test/Driver/masm.c work with the hexagon bot
Nico Weber [Tue, 13 May 2014 11:30:01 +0000 (11:30 +0000)]
try to make test/Driver/masm.c work with the hexagon bot

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

10 years agoDrop AST's version of ARMCXXABI, it doesn't differ from the Itanium base
Joerg Sonnenberger [Tue, 13 May 2014 11:20:16 +0000 (11:20 +0000)]
Drop AST's version of ARMCXXABI, it doesn't differ from the Itanium base
class.

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

10 years agoSupport -masm= flag for x86 targets.
Nico Weber [Tue, 13 May 2014 11:11:24 +0000 (11:11 +0000)]
Support -masm= flag for x86 targets.

`clang -S -o - file.c -masm=att` will write assembly to stdout in at&t syntax
(the default), `-masm=intel` will instead output intel style asm.

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

10 years agoclang-format: Don't break in the middle of ">>".
Daniel Jasper [Tue, 13 May 2014 08:01:47 +0000 (08:01 +0000)]
clang-format: Don't break in the middle of ">>".

Before:
  zzzzzzzzzz = bbbbbbbbbbbbbbbbb >
               > aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  zzzzzzzzzz
      = bbbbbbbbbbbbbbbbb
        >> aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);

This fixes llvm.org/PR19731.

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

10 years agoMS ABI: Tighten RTTI mangling
David Majnemer [Tue, 13 May 2014 06:57:43 +0000 (06:57 +0000)]
MS ABI: Tighten RTTI mangling

r208661 contained WIP code, commit the *actual* manglings.

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

10 years agoFixed a few tests and moved a comment to its proper place
Filipe Cabecinhas [Tue, 13 May 2014 05:21:11 +0000 (05:21 +0000)]
Fixed a few tests and moved a comment to its proper place

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

10 years agoPatched clang to emit x86 blends as shufflevectors.
Filipe Cabecinhas [Tue, 13 May 2014 02:37:02 +0000 (02:37 +0000)]
Patched clang to emit x86 blends as shufflevectors.

Summary:
Most of the clang header patch by Simon Pilgrim @ SCEE.
Also fixed (or added) clang tests for these intrinsics.

LLVM tests to make sure we get the blend instruction out of these
shufflevectors are at http://reviews.llvm.org/D3600

Reviewers: eli.friedman, craig.topper, rafael

Subscribers: cfe-commits

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

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

10 years agoRefactor to avoid explicitly listing all the different flavours of redeclarable
Richard Smith [Tue, 13 May 2014 01:15:00 +0000 (01:15 +0000)]
Refactor to avoid explicitly listing all the different flavours of redeclarable
declarations, and duplicating code between them.

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

10 years agoMS ABI: Preliminary RTTI mangling
David Majnemer [Tue, 13 May 2014 00:44:44 +0000 (00:44 +0000)]
MS ABI: Preliminary RTTI mangling

Implement what we currently believe is the mangling scheme for RTTI
data.  Tests will be added in a later commit which actually generate
RTTI data.

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

10 years agoRefactor and fix a latent bug (found by inspection) where an external AST
Richard Smith [Tue, 13 May 2014 00:34:43 +0000 (00:34 +0000)]
Refactor and fix a latent bug (found by inspection) where an external AST
source that provides a declaration from a hidden module would not have the
visibility of the produced definition checked. This might matter if an
external source chose to import a new module to provide an extra definition,
but is not observable with our current external sources.

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

10 years agoRemove unused PP variable NumIncluded
Will Wilson [Mon, 12 May 2014 21:26:54 +0000 (21:26 +0000)]
Remove unused PP variable NumIncluded

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

10 years ago[ASan] Fixup for r208610: link in asan_cxx library on Windows
Alexey Samsonov [Mon, 12 May 2014 20:20:20 +0000 (20:20 +0000)]
[ASan] Fixup for r208610: link in asan_cxx library on Windows

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

10 years agoclang-cl: accept -mllvm and -fsanitize_blacklist
Hans Wennborg [Mon, 12 May 2014 18:59:00 +0000 (18:59 +0000)]
clang-cl: accept -mllvm and -fsanitize_blacklist

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

10 years ago[ASan] Split static ASan runtime in two parts: asan and asan_cxx.
Alexey Samsonov [Mon, 12 May 2014 18:39:51 +0000 (18:39 +0000)]
[ASan] Split static ASan runtime in two parts: asan and asan_cxx.

asan_cxx containts replacements for new/delete operators, and should
only be linked in C++ mode. We plan to start building this part
with exception support to make new more standard-compliant.

See https://code.google.com/p/address-sanitizer/issues/detail?id=295
for more details.

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

10 years ago[scan-build] Pass --sysroot through for both compilation and linking.
Jordan Rose [Mon, 12 May 2014 17:04:44 +0000 (17:04 +0000)]
[scan-build] Pass --sysroot through for both compilation and linking.

PR19704

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

10 years agoclang-format: [JS] Basic support for escape sequences in regex literals.
Daniel Jasper [Mon, 12 May 2014 11:29:50 +0000 (11:29 +0000)]
clang-format: [JS] Basic support for escape sequences in regex literals.

Before:
  var regex = /\\/ g; // This isn't even recognized as regex.

After:
  var regex = /\\/g; // It now is.

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

10 years agoclang/test/CXX/drs/dr4xx.cpp: Use env(1) to satisfy lit internal runner.
NAKAMURA Takumi [Mon, 12 May 2014 10:16:20 +0000 (10:16 +0000)]
clang/test/CXX/drs/dr4xx.cpp: Use env(1) to satisfy lit internal runner.

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

10 years ago[Driver] Do not lose already detected set of toolchain's multilibs while
Simon Atanasyan [Mon, 12 May 2014 07:37:51 +0000 (07:37 +0000)]
[Driver] Do not lose already detected set of toolchain's multilibs while
iterating over different library path suffixes and different library versions.

To find the most appropriate library for the given command line flags we
iterate over a set of disk paths. Before probe each path the already
detected set of multilibs are cleared. If the set of paths contains
existing paths which do not satisfy command line flags or do not contain
necessary libraries and object files at all we might lose found multilibs.

The patch updates variables which hold detected multilibs if we really find
a new multilib matches command line flags.

The patch reviewed by Jon Roelofs.

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

10 years agodisable asan's detect_stack_use_after_return when running CXX/drs/dr4xx.cpp (temporar...
Kostya Serebryany [Mon, 12 May 2014 07:05:16 +0000 (07:05 +0000)]
disable asan's detect_stack_use_after_return when running CXX/drs/dr4xx.cpp (temporary workaround for PR19722); This should make the asan bootstrap bot green again

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

10 years ago[C++11] Use 'nullptr'. AST edition.
Craig Topper [Mon, 12 May 2014 05:36:57 +0000 (05:36 +0000)]
[C++11] Use 'nullptr'. AST edition.

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

10 years ago[OPENMP] Removed unnecessary enums from OpenMP constructs
Alexey Bataev [Mon, 12 May 2014 04:23:46 +0000 (04:23 +0000)]
[OPENMP] Removed unnecessary enums from OpenMP constructs

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

10 years agoRevert "Revert "Another try at making MSVC happy again.""
Alp Toker [Sun, 11 May 2014 23:06:26 +0000 (23:06 +0000)]
Revert "Revert "Another try at making MSVC happy again.""

This didn't work out either.

Discussion at:
  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140505/105302.html

This reverts commit r208513.

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

10 years agoRevert "Another try at making MSVC happy again."
Alp Toker [Sun, 11 May 2014 22:12:18 +0000 (22:12 +0000)]
Revert "Another try at making MSVC happy again."

Prospective revert to see if r208512 helped the MSVC build.

This reverts commit r208497.

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

10 years agoMake DiagnosticsEngine non-copyable
Alp Toker [Sun, 11 May 2014 22:10:52 +0000 (22:10 +0000)]
Make DiagnosticsEngine non-copyable

Also provide an out-of-line dtor for CompilerInvocation.

Cleanup work that may help reduce header inclusion for IntrusiveRefCntPtr.

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

10 years agoPR19713: Don't warn on unused static inline functions, even if the 'inline' was
Richard Smith [Sun, 11 May 2014 21:25:24 +0000 (21:25 +0000)]
PR19713: Don't warn on unused static inline functions, even if the 'inline' was
implied by 'constexpr'.

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

10 years agoDriver: Don't leak the -Xarch argument when its use is incorrect.
Nico Weber [Sun, 11 May 2014 17:27:13 +0000 (17:27 +0000)]
Driver: Don't leak the -Xarch argument when its use is incorrect.

(LLVM's lib/Option looks like it might appreciate being hit with the
std::unique_ptr stick.)

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

10 years agoc-index-test: Don't leak diagnostic category text.
Nico Weber [Sun, 11 May 2014 17:16:59 +0000 (17:16 +0000)]
c-index-test: Don't leak diagnostic category text.

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

10 years agoParameter/argument terminology fixes
Alp Toker [Sun, 11 May 2014 16:06:11 +0000 (16:06 +0000)]
Parameter/argument terminology fixes

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

10 years agoConsolidate single void paramter checking
Alp Toker [Sun, 11 May 2014 16:05:55 +0000 (16:05 +0000)]
Consolidate single void paramter checking

Also correct argument/parameter terminology.

No change in functionality.

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

10 years agoAnother try at making MSVC happy again.
Benjamin Kramer [Sun, 11 May 2014 16:03:08 +0000 (16:03 +0000)]
Another try at making MSVC happy again.

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

10 years agoPut back raw_ostream.h include.
Benjamin Kramer [Sun, 11 May 2014 10:41:20 +0000 (10:41 +0000)]
Put back raw_ostream.h include.

Some configurations of MSVC get horribly confused by the forward declaration
and explode.

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

10 years agoSilence warning in Release builds. This function is only used in an assert.
Benjamin Kramer [Sun, 11 May 2014 09:31:47 +0000 (09:31 +0000)]
Silence warning in Release builds. This function is only used in an assert.

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

10 years agoCodeGen: support dll{ex,im}port on WoA
Saleem Abdulrasool [Sun, 11 May 2014 01:31:57 +0000 (01:31 +0000)]
CodeGen: support dll{ex,im}port on WoA

Add ARM support for dllexport and dllimport attributes.  This is a relatively
conservative change.  The alternative is to entirely drop the architecture
requirement.  The dllimport and dllexport attributes are not restricted to any
architecture, simply to platforms that support this attribute (currently
Windows).

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

10 years agoWrap at 80 columns. No code change.
Nico Weber [Sun, 11 May 2014 01:04:02 +0000 (01:04 +0000)]
Wrap at 80 columns. No code change.

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

10 years agoFollow-up to r208481: Free all default arguments, not just the first one.
Nico Weber [Sun, 11 May 2014 00:28:16 +0000 (00:28 +0000)]
Follow-up to r208481: Free all default arguments, not just the first one.

Also add test coverage for this case.  Found by Richard Smith!

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

10 years agoDon't leak CXStrings for replacement fix-its in c-index-test.
Nico Weber [Sat, 10 May 2014 23:56:43 +0000 (23:56 +0000)]
Don't leak CXStrings for replacement fix-its in c-index-test.

The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

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