]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Revamp nested block formatting.
Daniel Jasper [Fri, 12 Dec 2014 09:40:58 +0000 (09:40 +0000)]
clang-format: Revamp nested block formatting.

This fixed llvm.org/PR21804 and hopefully a few other strange cases.

Before:
    if (blah_blah(whatever, whatever, [] {
      doo_dah();
      doo_dah();
    })) {
    }
    }

After:
    if (blah_blah(whatever, whatever, [] {
          doo_dah();
          doo_dah();
        })) {
    }
    }

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

9 years agoCodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile
David Majnemer [Fri, 12 Dec 2014 08:16:09 +0000 (08:16 +0000)]
CodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile

Don't inherit the volatile-ness of the input pointer to the volatile
operation for memory allocated on the side.

This fixes PR17306.

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

9 years agoDo not warn on keyword undef
Serge Pavlov [Fri, 12 Dec 2014 06:37:55 +0000 (06:37 +0000)]
Do not warn on keyword undef

#undef a keyword is generally harmless but used often in configuration scripts.
Also added tests that I forgot to include to commit in r223114.

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

9 years ago[Objective-C]. This patch extends objc_bridge attribute to support objc_bridge(id).
Fariborz Jahanian [Thu, 11 Dec 2014 22:56:26 +0000 (22:56 +0000)]
[Objective-C]. This patch extends  objc_bridge attribute to support objc_bridge(id).
This means that a pointer to the struct type to which the attribute appertains
is a CF type (and therefore an Objective-C object of some type), but not of any
specific class. rdar://19157264

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

9 years ago[modules] When constructing paths relative to a module, strip out /./ directory
Richard Smith [Thu, 11 Dec 2014 20:50:24 +0000 (20:50 +0000)]
[modules] When constructing paths relative to a module, strip out /./ directory
components. These sometimes get synthetically added, and we don't want -Ifoo
and -I./foo to be treated fundamentally differently here.

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

9 years agoInstead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
Paul Robinson [Thu, 11 Dec 2014 20:14:04 +0000 (20:14 +0000)]
Instead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
having OptimizeNone remove them again, just don't add them in the
first place if the function already has OptimizeNone.

Note that MinSize can still appear due to attributes on different
declarations; a future patch will address that.

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

9 years agoAST: Incomplete types might be zero sized
David Majnemer [Thu, 11 Dec 2014 19:36:24 +0000 (19:36 +0000)]
AST: Incomplete types might be zero sized

Comparing the address of an object with an incomplete type might return
true with a 'distinct' object if the former has a size of zero.
However, such an object should compare unequal with null.

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

9 years agoWhen checking for nonnull parameter attributes, also check the ParmVarDecl since...
Aaron Ballman [Thu, 11 Dec 2014 19:35:42 +0000 (19:35 +0000)]
When checking for nonnull parameter attributes, also check the ParmVarDecl since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668.

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

9 years agoEmit warning if define or undef reserved identifier or keyword.
Serge Pavlov [Thu, 11 Dec 2014 12:18:08 +0000 (12:18 +0000)]
Emit warning if define or undef reserved identifier or keyword.

Recommit of r223114, reverted in r223120.

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

9 years agoMS ABI: Fix mangling of unsigned int template params
Will Wilson [Thu, 11 Dec 2014 05:47:10 +0000 (05:47 +0000)]
MS ABI: Fix mangling of unsigned int template params

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

9 years agoParse: Concatenated string literals should be verified in inline asm
David Majnemer [Thu, 11 Dec 2014 01:00:48 +0000 (01:00 +0000)]
Parse: Concatenated string literals should be verified in inline asm

While we would correctly handle asm("foo") and reject asm(L"bar"), we
weren't careful to handle cases where an ascii literal could be
concatenated with a wide literal.

This fixes PR21822.

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

9 years agoRevert r223578, perf data collection depends on the old symbol name.
Paul Robinson [Wed, 10 Dec 2014 23:49:03 +0000 (23:49 +0000)]
Revert r223578, perf data collection depends on the old symbol name.

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

9 years agoDiagnose attributes 'optnone' and 'minsize' on the same declaration.
Paul Robinson [Wed, 10 Dec 2014 23:34:36 +0000 (23:34 +0000)]
Diagnose attributes 'optnone' and 'minsize' on the same declaration.

Eventually we'll diagnose them on different declarations, but let's
get this part out of the way first.

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

9 years agoRevert r223980 as it had wrong commit message.
Paul Robinson [Wed, 10 Dec 2014 23:32:57 +0000 (23:32 +0000)]
Revert r223980 as it had wrong commit message.

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

9 years agoRename a couple of preprocessor symbols to be more descriptive. NFC.
Paul Robinson [Wed, 10 Dec 2014 23:12:37 +0000 (23:12 +0000)]
Rename a couple of preprocessor symbols to be more descriptive. NFC.
Review feedback from recent changes to GetSVN.cmake.

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

9 years agoForgot to commit this change with r223975
David Majnemer [Wed, 10 Dec 2014 23:08:43 +0000 (23:08 +0000)]
Forgot to commit this change with r223975

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

9 years agoAdd a FIXME for unifying ARM target abi handling.
Eric Christopher [Wed, 10 Dec 2014 22:58:34 +0000 (22:58 +0000)]
Add a FIXME for unifying ARM target abi handling.

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

9 years agoRevert the default changing behavior part of r216662 until we
Eric Christopher [Wed, 10 Dec 2014 22:58:32 +0000 (22:58 +0000)]
Revert the default changing behavior part of r216662 until we
can change the backend to be the same default. Leave the
modified/new testcases with the exception of the default behavior
since it increases our testing footprint.

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

9 years agoAST: Properly calculate the linkage of a IndirectFieldDecl
David Majnemer [Wed, 10 Dec 2014 22:58:14 +0000 (22:58 +0000)]
AST: Properly calculate the linkage of a IndirectFieldDecl

getLVForNamespaceScopeDecl believed that it wasn't possible for it to
ever see an IndirectFieldDecl.  However, this can occur when determining
whether or not something is a redeclaration of a member of an anonymous
static union.

This fixes PR21858.

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

9 years agoFixed an 80-column violation.
Sean Callanan [Wed, 10 Dec 2014 21:22:20 +0000 (21:22 +0000)]
Fixed an 80-column violation.

Thanks to Nico Weber for spotting this.

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

9 years agoDR1891, PR21787: a lambda closure type has no default constructor, rather than
Richard Smith [Wed, 10 Dec 2014 20:04:48 +0000 (20:04 +0000)]
DR1891, PR21787: a lambda closure type has no default constructor, rather than
having a deleted default constructor.

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

9 years agoMake test case 32/64 bit neutral
David Blaikie [Wed, 10 Dec 2014 19:19:24 +0000 (19:19 +0000)]
Make test case 32/64 bit neutral

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

9 years agoDebugInfo: Location information for scalar new expressions
David Blaikie [Wed, 10 Dec 2014 19:04:09 +0000 (19:04 +0000)]
DebugInfo: Location information for scalar new expressions

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

9 years agoclang-format: Factor out UnwrappedLineFormatter into a separate file.
Daniel Jasper [Wed, 10 Dec 2014 19:00:42 +0000 (19:00 +0000)]
clang-format: Factor out UnwrappedLineFormatter into a separate file.

No functional changes intended.

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

9 years agoAdded a testcase to make sure the parser allows
Sean Callanan [Wed, 10 Dec 2014 18:57:09 +0000 (18:57 +0000)]
Added a testcase to make sure the parser allows
but ignores module imports in debugger mode,
even inside functions.

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

9 years agoObjective-C SDK modernizer. When modernizing an enum to
Fariborz Jahanian [Wed, 10 Dec 2014 18:25:24 +0000 (18:25 +0000)]
Objective-C SDK modernizer. When modernizing an enum to
NS_ENUM/NS_OPTIONS use the underlying type if there is
no associated type. rdar://19198042

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

9 years agoclang-format: Remove a few else after return statements.
Daniel Jasper [Wed, 10 Dec 2014 17:24:34 +0000 (17:24 +0000)]
clang-format: Remove a few else after return statements.

They are against the LLVM coding conventions. No functional changes
intended.

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

9 years agoOpenCL C: Add support for a set of floating point
Pekka Jaaskelainen [Wed, 10 Dec 2014 16:41:14 +0000 (16:41 +0000)]
OpenCL C: Add support for a set of floating point
arithmetic relaxation flags:

-cl-no-signed-zeros
-cl-unsafe-math-optimizations
-cl-finite-math-only
-cl-fast-relaxed-math

Propagate the info to FP instruction flags as well
as function attributes where they are available.

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

9 years ago[mips] Removing __SIZEOF_INT128__ macro for MIPS64
Simon Atanasyan [Wed, 10 Dec 2014 15:44:07 +0000 (15:44 +0000)]
[mips] Removing __SIZEOF_INT128__ macro for MIPS64

This is a temporary workaround while MIPS64 has not yet fully supported
128-bit integers. But declaration of int128 type is necessary even though
`__SIZEOF_INT128__` is undefined because c++ standard header files like
`limits` throw error message if `__int128` is not available.

Patch by Sagar Thakur.

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

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

9 years agoclang/test/Modules/modular_maps.cpp REQUIRES shell. chdir is unsupported on Lit inter...
NAKAMURA Takumi [Wed, 10 Dec 2014 08:20:32 +0000 (08:20 +0000)]
clang/test/Modules/modular_maps.cpp REQUIRES shell. chdir is unsupported on Lit internal runner.

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

9 years agoReinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Richard Smith [Wed, 10 Dec 2014 03:09:48 +0000 (03:09 +0000)]
Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Original commit message:

[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

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

9 years agoFixed the AST importer ot use redeclaration contexts properly.
Sean Callanan [Wed, 10 Dec 2014 03:09:41 +0000 (03:09 +0000)]
Fixed the AST importer ot use redeclaration contexts properly.

To ensure that we don't import duplicates, the ASTImporter often
checks the DeclContext for a Decl before importing it to see if
a Decl with the same name is already present.

This is problematic if the Decl is inside a transparent context
like an extern "C" block.  Lookup isn't allowed on such contexts,
and in fact they assert() if you do that.  So instead we look at
the redeclaration context -- the containing context that can be
used safely for these kinds of checks -- instead.

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

9 years agoDebugInfo: Correct location information for array accesses to elements of variable...
David Blaikie [Wed, 10 Dec 2014 01:34:25 +0000 (01:34 +0000)]
DebugInfo: Correct location information for array accesses to elements of variable array type.

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

9 years agoMade the ASTImporter resilient if it can't import
Sean Callanan [Wed, 10 Dec 2014 01:26:39 +0000 (01:26 +0000)]
Made the ASTImporter resilient if it can't import
SourceLocations.  LLDB rarely has the same files
mapped into the target AST context as the source
AST context, so the ASTImporter shouldn't expect
to see those files there.

This started to become a problem when importing
entities from modules -- these have proper source
locations, in contrast to all the ASTs LLDB
creates which have empty ones.

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

9 years agoDebugInfo: Fix another case of array access line information
David Blaikie [Wed, 10 Dec 2014 01:16:09 +0000 (01:16 +0000)]
DebugInfo: Fix another case of array access line information

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

9 years agoDebugInfo: Correct the location of array accesses
David Blaikie [Wed, 10 Dec 2014 01:03:48 +0000 (01:03 +0000)]
DebugInfo: Correct the location of array accesses

Especially relevant to ASan when dealing with complex expressions
containing multiple array accesses. See PR21737.

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

9 years agoMake sure that vec_perm is listed as a static function in altivec.h.
Eric Christopher [Wed, 10 Dec 2014 00:57:43 +0000 (00:57 +0000)]
Make sure that vec_perm is listed as a static function in altivec.h.

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

9 years agoTweak test case from r223842 to make it pass on Windows MSVC
Reid Kleckner [Wed, 10 Dec 2014 00:47:33 +0000 (00:47 +0000)]
Tweak test case from r223842 to make it pass on Windows MSVC

We can't mangle __complex yet, and there is no C1 emission.

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

9 years agocmake: Make SVNVersion.inc step depend on GetSVN.cmake.
Nico Weber [Wed, 10 Dec 2014 00:03:37 +0000 (00:03 +0000)]
cmake: Make SVNVersion.inc step depend on GetSVN.cmake.

This way, the step generating SVNVersion.inc gets rerun every time someone
changes GetSVN.cmake (which is the file that decides how the contents of
SVNVersion.inc look). This makes hacking on GetSVN.cmake a bit easier.

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

9 years agoUpdated the AST importer to support importing
Sean Callanan [Wed, 10 Dec 2014 00:00:37 +0000 (00:00 +0000)]
Updated the AST importer to support importing
LinkageSpecDecls.  This is relevant when LLDB
wants to import Decls from non-C++ modules,
since many declarations are in extern "C"
blocks.

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

9 years agoModified the Objective-C lexer and parser (only
Sean Callanan [Tue, 9 Dec 2014 23:47:56 +0000 (23:47 +0000)]
Modified the Objective-C lexer and parser (only
in debugger mode) to accept @import declarations
and pass them to the debugger.

In the preprocessor, accept import declarations
if the debugger is enabled, but don't actually
load the module, just pass the import path on to
the preprocessor callbacks.

In the Objective-C parser, if it sees an import
declaration in statement context (usual for LLDB),
ignore it and return a NullStmt.

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

9 years agoDebugInfo: Correct location of aggregate assignment
David Blaikie [Tue, 9 Dec 2014 23:33:26 +0000 (23:33 +0000)]
DebugInfo: Correct location of aggregate assignment

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

9 years agoAST: Don't assume two zero sized objects live at different addresses
David Majnemer [Tue, 9 Dec 2014 23:32:34 +0000 (23:32 +0000)]
AST: Don't assume two zero sized objects live at different addresses

Zero sized objects may overlap with each other or any other object.

This fixes PR21786.

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

9 years agoclang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).
Nico Weber [Tue, 9 Dec 2014 23:22:35 +0000 (23:22 +0000)]
clang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).

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

9 years agoObjective-C SDK modernizer. Modernize to use
Fariborz Jahanian [Tue, 9 Dec 2014 22:36:47 +0000 (22:36 +0000)]
Objective-C SDK modernizer. Modernize to use
property-dot-syntax when receiver is 'super'.
rdar://19140267

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

9 years agoDebugInfo: Correct location of initialization of auto __complex
David Blaikie [Tue, 9 Dec 2014 22:15:02 +0000 (22:15 +0000)]
DebugInfo: Correct location of initialization of auto __complex

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

9 years agoDebugInfo: Correct the location of initializations of auto.
David Blaikie [Tue, 9 Dec 2014 22:04:13 +0000 (22:04 +0000)]
DebugInfo: Correct the location of initializations of auto.

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

9 years agoDebugInfo: Correct location for compound complex assignment
David Blaikie [Tue, 9 Dec 2014 21:32:00 +0000 (21:32 +0000)]
DebugInfo: Correct location for compound complex assignment

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

9 years agoDebugInfo: Accurate location information for complex assignment
David Blaikie [Tue, 9 Dec 2014 21:10:43 +0000 (21:10 +0000)]
DebugInfo: Accurate location information for complex assignment

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

9 years agoDebugInfo: Emit the correct location for initialization of a complex variable
David Blaikie [Tue, 9 Dec 2014 20:52:24 +0000 (20:52 +0000)]
DebugInfo: Emit the correct location for initialization of a complex variable

Especially useful for sanitizer reports.

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

9 years agoFix a GCC error from r223803
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 19:22:40 +0000 (19:22 +0000)]
Fix a GCC error from r223803

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

9 years agoIR: Update clang for Metadata/Value split in r223802
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 18:39:32 +0000 (18:39 +0000)]
IR: Update clang for Metadata/Value split in r223802

Match LLVM API changes from r223802.

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

9 years agoDon't actually generate code for testing the frontend's target cpu flag,
Chandler Carruth [Tue, 9 Dec 2014 15:52:55 +0000 (15:52 +0000)]
Don't actually generate code for testing the frontend's target cpu flag,
just verify. This should fix the bots where the x86 backend isn't built
into Clang. Sorry for the breakage.

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

9 years agoRe-work the Clang system for classifying Intel x86 CPUs to use their
Chandler Carruth [Tue, 9 Dec 2014 14:50:25 +0000 (14:50 +0000)]
Re-work the Clang system for classifying Intel x86 CPUs to use their
basic microarchitecture names, and add support (with tests) for parsing
all of the masic microarchitecture names for CPUs documented to be
accepted by GCC with -march. I didn't go back through the 32-bit-only
old microarchitectures, but this at least brings the recent architecture
names up to speed. This is essentially the follow-up to the LLVM commit
r223769 which did similar cleanups for the LLVM CPUs.

One particular benefit is that you can now use -march=westmere in Clang
and get the LLVM westmere processor which is a different ISA variant (!)
and so quite significant.

Much like with r223769, I would appreciate the Intel folks carefully
thinking about the macros defined, names used, etc for the atom chips
and newest primary x86 chips. The current patterns seem quite strange to
me, especially here in Clang.

Note that I haven't replicated the per-microarchitecture macro defines
provided by GCC. I'm really opposed to source code using these rather
than using ISA feature macros.

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

9 years agoRevert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 06:35:37 +0000 (06:35 +0000)]
Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."

This reverts commit r223753.  It broke the Green Dragon build for a few
hours:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/
  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c

I suspect `clang-tools-extra` just needs a follow-up for an API change,
but I'm not the right one to look into it.

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

9 years ago[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.
Richard Smith [Tue, 9 Dec 2014 03:20:04 +0000 (03:20 +0000)]
[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

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

9 years agoMS ABI: Add another test for PR20017
David Majnemer [Tue, 9 Dec 2014 01:36:45 +0000 (01:36 +0000)]
MS ABI: Add another test for PR20017

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

9 years agoDebugInfo: Correctly identify the location of C++ member initializer list elements
David Blaikie [Tue, 9 Dec 2014 00:32:22 +0000 (00:32 +0000)]
DebugInfo: Correctly identify the location of C++ member initializer list elements

This particularly helps the fidelity of ASan reports (which can occur
even in these examples - if, for example, one uses placement new over a
buffer of insufficient size - now ASan will correctly identify which
member's initialization went over the end of the buffer).

This doesn't cover all types of members - more coming.

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

9 years ago[modules] If the same .pcm file is imported via two different paths, don't
Richard Smith [Tue, 9 Dec 2014 00:14:36 +0000 (00:14 +0000)]
[modules] If the same .pcm file is imported via two different paths, don't
complain that the contained modules are defined twice.

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

9 years agoRevert "Driver: Objective-C should respect -fno-exceptions"
David Majnemer [Tue, 9 Dec 2014 00:12:30 +0000 (00:12 +0000)]
Revert "Driver: Objective-C should respect -fno-exceptions"

This reverts commit r223455.  It's been succesfully argued that
-fexceptions (at the driver level) is a misnomer and has little to do
with -fobjc-exceptions.

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

9 years agoAdd a test for MS-ABI this adjustment for virtual calls to member operators.
Nico Weber [Mon, 8 Dec 2014 23:25:55 +0000 (23:25 +0000)]
Add a test for MS-ABI this adjustment for virtual calls to member operators.

They too were fixed by r223185, despite the commit message saying otherwise.
Add a test that makes sure they don't regress.

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

9 years agoHandle possible TypoExprs in member initializers.
Kaelyn Takata [Mon, 8 Dec 2014 22:41:42 +0000 (22:41 +0000)]
Handle possible TypoExprs in member initializers.

Includes a new test case since none of the existing tests were hitting
this code path.

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

9 years agoDebugInfo: Ensure the store for an assignment is attributed to the beginning of the...
David Blaikie [Mon, 8 Dec 2014 21:48:57 +0000 (21:48 +0000)]
DebugInfo: Ensure the store for an assignment is attributed to the beginning of the assignment expression

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

9 years agoclang-format: Indent correctly in conditional expressions after return.
Daniel Jasper [Mon, 8 Dec 2014 21:28:31 +0000 (21:28 +0000)]
clang-format: Indent correctly in conditional expressions after return.

This only applies when not aligning after the return itself (which is
commonly done for C++.

Before:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
             bbbbbb)  // This is indented relative to aaaaaaaaaa.
      : b;

After:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
            bbbbbb)
      : b;

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

9 years agoFix isInstantiated and isInTemplateInstantiation to not recreate the matchers on...
Samuel Benzaquen [Mon, 8 Dec 2014 20:17:58 +0000 (20:17 +0000)]
Fix isInstantiated and isInTemplateInstantiation to not recreate the matchers on each call.

Summary:
Store the result matcher after the first call and reuse it later on.
Recreating the matchers just to use them once incurs in a lot of
unnecessary temporary memory allocations.
This change speeds up our clang-tidy benchmarks by ~2%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoclang-format: [Java] Always break after annotations of multiline decls.
Daniel Jasper [Mon, 8 Dec 2014 20:08:04 +0000 (20:08 +0000)]
clang-format: [Java] Always break after annotations of multiline decls.

Before:
  @Mock DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  @Mock
  DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

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

9 years agoclang-format: Make clang-format-diff.py format java files.
Daniel Jasper [Mon, 8 Dec 2014 19:39:03 +0000 (19:39 +0000)]
clang-format: Make clang-format-diff.py format java files.

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

9 years agoInstrProf: Use LLVM's -instrprof pass for profiling
Justin Bogner [Mon, 8 Dec 2014 19:04:51 +0000 (19:04 +0000)]
InstrProf: Use LLVM's -instrprof pass for profiling

The logic for lowering profiling counters has been moved to an LLVM
pass. Emit the intrinsics rather than duplicating the whole pass in
clang.

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

9 years agoclang-format: Support commas in lambda return types.
Daniel Jasper [Mon, 8 Dec 2014 13:22:37 +0000 (13:22 +0000)]
clang-format: Support commas in lambda return types.

Before:
  auto next_pair = [](A * a) -> pair<A*, A*>{};

After:
  auto next_pair = [](A* a) -> pair<A*, A*>{};

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

9 years agoclang/test/Index/usrs.cpp: Appease targeting msvc.
NAKAMURA Takumi [Mon, 8 Dec 2014 10:20:33 +0000 (10:20 +0000)]
clang/test/Index/usrs.cpp: Appease targeting msvc.

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

9 years ago[libclang] Use same USR encoding for 'char' regardless of what the target considers...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 09:09:05 +0000 (09:09 +0000)]
[libclang] Use same USR encoding for 'char' regardless of what the target considers the sign to be.

Should fix the clang-hexagon-elf bot.

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

9 years ago[libclang] Encode InjectedClassNameType in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:43 +0000 (08:48 +0000)]
[libclang] Encode InjectedClassNameType in the USR.

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

9 years ago[libclang] Encode location info for anonymous embedded tag decls.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:37 +0000 (08:48 +0000)]
[libclang] Encode location info for anonymous embedded tag decls.

Otherwise the USR will conflict with different embedded tag decls.

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

9 years ago[libclang] Use same USR encoding for 'class' as 'struct'.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:33 +0000 (08:48 +0000)]
[libclang] Use same USR encoding for 'class' as 'struct'.

'class' and 'struct' can be used interchangebly for forward references.
Use the same encoding otherwise we may get into a weird situation where the USR for the same
declaration is different based on whether the definition of the tag reference is visible or not.

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

9 years ago[libclang] Encode C++11 rvalue reference types in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:27 +0000 (08:48 +0000)]
[libclang] Encode C++11 rvalue reference types in the USR.

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

9 years ago[libclang] Encode the C++11 method reference qualifier in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:21 +0000 (08:48 +0000)]
[libclang] Encode the C++11 method reference qualifier in the USR.

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

9 years ago[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overl...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:17 +0000 (08:48 +0000)]
[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overload a 'char' in C++, by giving them distinct encodings.

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

9 years ago[libclang] Function templates can be 'overloaded' by return type, so encode the retur...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:11 +0000 (08:48 +0000)]
[libclang] Function templates can be 'overloaded' by return type, so encode the return type in the USR
and handle DependentNameType in order to be able to distinguish them.

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

9 years agoclang-format: Don't merge lines with comments.
Daniel Jasper [Sun, 7 Dec 2014 16:44:49 +0000 (16:44 +0000)]
clang-format: Don't merge lines with comments.

Before:
  int f() { // comment return 42; }

After:
  int f() { // comment
    return 42;
  }

This fixes llvm.org/PR21769.

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

9 years agoAdd some file content to avoid test failures on content-addressed file systems.
Richard Smith [Sat, 6 Dec 2014 22:12:07 +0000 (22:12 +0000)]
Add some file content to avoid test failures on content-addressed file systems.

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

9 years agoAdd test file missed from r223561.
Richard Smith [Sat, 6 Dec 2014 22:11:06 +0000 (22:11 +0000)]
Add test file missed from r223561.

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

9 years agoRename a couple of preprocessor symbols to be more descriptive. NFC.
Paul Robinson [Sat, 6 Dec 2014 05:06:37 +0000 (05:06 +0000)]
Rename a couple of preprocessor symbols to be more descriptive. NFC.
Review feedback from recent changes to GetSVN.cmake.

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

9 years ago[modules] If we import a module, and we've seen a module map that describes the
Richard Smith [Sat, 6 Dec 2014 03:21:08 +0000 (03:21 +0000)]
[modules] If we import a module, and we've seen a module map that describes the
module, use the path from the module map file in preference to the path from
the .pcm file when resolving relative paths in the .pcm file. This allows
diagnostics (and .d output) to give relative paths if the module was found via
a relative path.

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

9 years agoNo memcpy for copy ctor with -fsanitize-address-field-padding=1
Kostya Serebryany [Sat, 6 Dec 2014 01:23:08 +0000 (01:23 +0000)]
No memcpy for copy ctor with -fsanitize-address-field-padding=1

Summary:
When -fsanitize-address-field-padding=1 is present
don't emit memcpy for copy constructor.
Thanks Nico for the extra test case.

Test Plan: regression tests

Reviewers: thakis, rsmith

Reviewed By: rsmith

Subscribers: rsmith, cfe-commits

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

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

9 years agoPR21217: Slightly more eagerly load -fmodule-map-file= files and provide
Richard Smith [Sat, 6 Dec 2014 01:13:41 +0000 (01:13 +0000)]
PR21217: Slightly more eagerly load -fmodule-map-file= files and provide
diagnostics if they don't exist. Based on a patch by John Thompson!

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

9 years agoAdditional safety for the root cause of regression in r223443; make the module
Richard Smith [Sat, 6 Dec 2014 00:09:19 +0000 (00:09 +0000)]
Additional safety for the root cause of regression in r223443; make the module
map path more canonical before hashing it. No functionality change.

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

9 years ago[modules] Instead of storing absolute paths in a .pcm file, store the path to
Richard Smith [Fri, 5 Dec 2014 22:42:13 +0000 (22:42 +0000)]
[modules] Instead of storing absolute paths in a .pcm file, store the path to
the root of the module and use paths relative to that directory wherever
possible. This is a step towards allowing explicit modules to be relocated
without being rebuilt, which is important for some kinds of distributed builds,
for good paths in diagnostics, and for appropriate .d output.

This is a recommit of r223443, reverted in r223465; when joining together
imported file paths, we now use the system's separator rather than always
using '/'. This avoids path mismatches between the original module build and
the module user on Windows (at least, in some cases). A more comprehensive
fix will follow.

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

9 years agoASTDumper: print whether a function is constexpr
Hans Wennborg [Fri, 5 Dec 2014 22:38:57 +0000 (22:38 +0000)]
ASTDumper: print whether a function is constexpr

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

9 years agoSpecify the name of the generated header only once. NFC.
Paul Robinson [Fri, 5 Dec 2014 22:32:49 +0000 (22:32 +0000)]
Specify the name of the generated header only once. NFC.
This will also simplify a private patch that we have.

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

9 years agoMake DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.
Richard Smith [Fri, 5 Dec 2014 21:52:58 +0000 (21:52 +0000)]
Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.
Patch by Brad King!

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

9 years agoWorkaround attribute ordering issue with kernel only attributes
Matt Arsenault [Fri, 5 Dec 2014 18:03:58 +0000 (18:03 +0000)]
Workaround attribute ordering issue with kernel only attributes

Placing the attribute after the kernel keyword would incorrectly
reject the attribute, so use the smae workaround that other
kernel only attributes use.

Also add a FIXME because there are two different phrasings now
for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one.

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

9 years agoUse else if when checking multiple attributes.
Matt Arsenault [Fri, 5 Dec 2014 18:03:55 +0000 (18:03 +0000)]
Use else if when checking multiple attributes.

Only one of these can really match.

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

9 years agoAmending r223468 with this documentation change.
Aaron Ballman [Fri, 5 Dec 2014 17:11:49 +0000 (17:11 +0000)]
Amending r223468 with this documentation change.

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

9 years agoFix Typos in include/clang-c/Index.h
Chad Rosier [Fri, 5 Dec 2014 15:50:44 +0000 (15:50 +0000)]
Fix Typos in include/clang-c/Index.h
Phabricator revision: http://reviews.llvm.org/D6507

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

9 years agoModify __has_attribute so that it only looks for GNU-style attributes. Removes the...
Aaron Ballman [Fri, 5 Dec 2014 15:24:55 +0000 (15:24 +0000)]
Modify __has_attribute so that it only looks for GNU-style attributes. Removes the ability to look for generic attributes and keywords via this macro, which has the potential to be a breaking change. However, since there is __has_cpp_attribute and __has_declspec_attribute, and given the limited usefulness of querying a generic attribute name regardless of syntax, this seems like the correct path forward.

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

9 years agoAdded a new preprocessor macro: __has_declspec_attribute. This can be used as a way...
Aaron Ballman [Fri, 5 Dec 2014 15:05:29 +0000 (15:05 +0000)]
Added a new preprocessor macro: __has_declspec_attribute. This can be used as a way to determine whether Clang supports a __declspec spelling for a given attribute, similar to  __has_attribute and __has_cpp_attribute.

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

9 years agoTemporarily reverting r223443 due to bot breakage.
Aaron Ballman [Fri, 5 Dec 2014 14:52:04 +0000 (14:52 +0000)]
Temporarily reverting r223443 due to bot breakage.

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

9 years agoFix a warning with generating the attribute documentation; NFC.
Aaron Ballman [Fri, 5 Dec 2014 14:11:39 +0000 (14:11 +0000)]
Fix a warning with generating the attribute documentation; NFC.

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

9 years agoclang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.
Daniel Jasper [Fri, 5 Dec 2014 10:42:21 +0000 (10:42 +0000)]
clang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.

This fixes llvm.org/PR21756.

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

9 years agoDriver: Objective-C should respect -fno-exceptions
David Majnemer [Fri, 5 Dec 2014 08:56:55 +0000 (08:56 +0000)]
Driver: Objective-C should respect -fno-exceptions

Clang attempted to replicate a GCC bug: -fobjc-exceptions forces
-fexceptions to be enabled.  However, this has unintended effects and
other awkard side effects that Clang doesn't "correctly" ape (e.g. it's
impossible to turn off C++ exceptions in ObjC++ mode).

Instead, -f[no]objc-exceptions and -f[no]cxx-exceptions now have an
identical relationship with -f[no]exceptions.

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