]> granicus.if.org Git - clang/log
clang
10 years agoUnify __declspec attribute argument parsing with the common attribute argument parsin...
Aaron Ballman [Mon, 31 Mar 2014 18:18:43 +0000 (18:18 +0000)]
Unify __declspec attribute argument parsing with the common attribute argument parsing code.

This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording.

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

10 years agoIntroduced an attribute syntax-neutral method for parsing attribute arguments that...
Aaron Ballman [Mon, 31 Mar 2014 17:32:39 +0000 (17:32 +0000)]
Introduced an attribute syntax-neutral method for parsing attribute arguments that is currently being used by GNU and C++-style attributes. This allows C++11 attributes with argument lists to be handled properly, fixing the "deprecated", "type_visibility", and capability-related attributes with arguments.

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

10 years agoMS ABI: mangleStringLiteral shouldn't rely on the host's endianness
David Majnemer [Mon, 31 Mar 2014 17:18:53 +0000 (17:18 +0000)]
MS ABI: mangleStringLiteral shouldn't rely on the host's endianness

No test case is needed, the one in-tree is sufficient.  The build-bot
never emailed me because something else had upset it.

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

10 years agoMS ABI: Document the '\xc1' to '\xda' manglings
David Majnemer [Mon, 31 Mar 2014 17:09:09 +0000 (17:09 +0000)]
MS ABI: Document the '\xc1' to '\xda' manglings

No functionality change.

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

10 years agoRemove unused diagnostic + dead test for it.
Benjamin Kramer [Mon, 31 Mar 2014 16:55:01 +0000 (16:55 +0000)]
Remove unused diagnostic + dead test for it.

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

10 years agoMS ABI: Make test introduced in r205217 more robust
David Majnemer [Mon, 31 Mar 2014 16:30:00 +0000 (16:30 +0000)]
MS ABI: Make test introduced in r205217 more robust

Don't assume any particular IR Value name, pattern match the names from
the GEP instructions instead.

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

10 years agoMS ABI: Use the proper type for inalloca args
David Majnemer [Mon, 31 Mar 2014 16:12:47 +0000 (16:12 +0000)]
MS ABI: Use the proper type for inalloca args

Summary:
The definition of a type later in a translation unit may change it's
type from {}* to (%struct.foo*)*.  Earlier function definitions may use
the former while more recent definitions might use the later.  This is
fine until they interact with one another (like one calling the other).
In these cases, a bitcast is needed because the inalloca must match the
function call but the store to the lvalue which initializes the argument
slot has to match the rvalue's type.

This technique is along the same lines with what the other,
non-inalloca, codepaths perform.

This fixes PR19287.

Reviewers: rnk

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3224

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

10 years agoARM64: enable aarch64-neon-intrinsics.c test
Tim Northover [Mon, 31 Mar 2014 15:47:09 +0000 (15:47 +0000)]
ARM64: enable aarch64-neon-intrinsics.c test

This adds support for the various NEON intrinsics used by
aarch64-neon-intrinsics.c (originally written for AArch64) and enables the
test.

My implementations are designed to be semantically correct, the actual code
quality looks like its a wash between the two backends, and is frequently
different (hence the large number of CHECK changes).

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

10 years agoPost-commit review coding style change: renaming HasAttribute to hasAttribute. No...
Aaron Ballman [Mon, 31 Mar 2014 15:26:40 +0000 (15:26 +0000)]
Post-commit review coding style change: renaming HasAttribute to hasAttribute. No functional changes.

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

10 years ago[OPENMP] clang-formatted include/clang/AST/StmtOpenMP.h
Alexander Musman [Mon, 31 Mar 2014 15:08:32 +0000 (15:08 +0000)]
[OPENMP] clang-formatted include/clang/AST/StmtOpenMP.h

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

10 years agoSema: Require external linkage for dll attributes
Nico Rieck [Mon, 31 Mar 2014 14:56:58 +0000 (14:56 +0000)]
Sema: Require external linkage for dll attributes

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

10 years agoSema: Check dll attributes on redeclarations
Nico Rieck [Mon, 31 Mar 2014 14:56:15 +0000 (14:56 +0000)]
Sema: Check dll attributes on redeclarations

A redeclaration may not add dllimport or dllexport attributes. dllexport is
sticky and can be omitted on redeclarations while dllimport cannot.

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

10 years agoclang-format: Solve issues found and fixed by clang-tidy.
Daniel Jasper [Mon, 31 Mar 2014 14:23:49 +0000 (14:23 +0000)]
clang-format: Solve issues found and fixed by clang-tidy.

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

10 years agoclang/tools/driver/Makefile: Quick fix corresponding to r205181.
NAKAMURA Takumi [Mon, 31 Mar 2014 14:11:11 +0000 (14:11 +0000)]
clang/tools/driver/Makefile: Quick fix corresponding to r205181.

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

10 years agoReapplying r204952 a second time.
Aaron Ballman [Mon, 31 Mar 2014 13:14:44 +0000 (13:14 +0000)]
Reapplying r204952 a second time.

Clean up the __has_attribute implementation without modifying its behavior.

Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes).

Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options.

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

10 years agoSlightly improve the readability of MicrosoftVTableContext::computeVTablePaths()...
Timur Iskhodzhanov [Mon, 31 Mar 2014 11:01:51 +0000 (11:01 +0000)]
Slightly improve the readability of MicrosoftVTableContext::computeVTablePaths().  No functionality changes.

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

10 years agoAdded _rdtsc intrinsics by Robert Khasanov
Alexey Volkov [Mon, 31 Mar 2014 08:08:46 +0000 (08:08 +0000)]
Added _rdtsc intrinsics by Robert Khasanov

Differential Revision: http://llvm-reviews.chandlerc.com/D3212

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

10 years agoRemove unused variable
Dmitri Gribenko [Mon, 31 Mar 2014 07:52:35 +0000 (07:52 +0000)]
Remove unused variable

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

10 years agoARM64: remove currently trivial switch statement
Tim Northover [Mon, 31 Mar 2014 07:20:13 +0000 (07:20 +0000)]
ARM64: remove currently trivial switch statement

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

10 years ago[OPENMP] Implemented 'copyin' clause
Alexey Bataev [Mon, 31 Mar 2014 03:36:38 +0000 (03:36 +0000)]
[OPENMP] Implemented 'copyin' clause

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

10 years agoAdd documentation for the pcs attribute, based on r129534's commit message.
Nico Weber [Sun, 30 Mar 2014 19:45:58 +0000 (19:45 +0000)]
Add documentation for the pcs attribute, based on r129534's commit message.

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

10 years agoRTTI: refactor the uniqueness question into CGCXXABI.
Tim Northover [Sun, 30 Mar 2014 17:32:48 +0000 (17:32 +0000)]
RTTI: refactor the uniqueness question into CGCXXABI.

This also brings the code into closer conformance with usual LLVM
coding style and other surrounding conventions.

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

10 years agoMS ABI: Correct typo in mangleStringLiteral
David Majnemer [Sun, 30 Mar 2014 16:38:02 +0000 (16:38 +0000)]
MS ABI: Correct typo in mangleStringLiteral

No functionality change.

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

10 years agoMS ABI: Simplify mangleTemplateArgs
David Majnemer [Sun, 30 Mar 2014 16:30:54 +0000 (16:30 +0000)]
MS ABI: Simplify mangleTemplateArgs

No functionality change.

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

10 years agoclang/test/Preprocessor/headermap-rel2.c: Recognize dos path.
NAKAMURA Takumi [Sun, 30 Mar 2014 15:09:08 +0000 (15:09 +0000)]
clang/test/Preprocessor/headermap-rel2.c: Recognize dos path.

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

10 years agoForce a header file input to the headermap test to have different
Chandler Carruth [Sun, 30 Mar 2014 14:04:32 +0000 (14:04 +0000)]
Force a header file input to the headermap test to have different
contents than the header file by the same name under the system header
search root. Surprisingly, this is required to get the test to pass on
some systems.

So, it turns out that there exist filesystems in the world which unique
the inode of all files based on their contents. This results in two
files with the same contents at different paths suddenly having the same
inode. This doesn't actually cause any problems in practice as the
contents are the same, and the path used to access the files are the
same. However, it can cause tests like this one to be more brittle
because the file manager ends up de-duplicating the file entries by
inode. We don't have any other really easy ways to observe the behavior
shift because the whole point is that the #include written in the source
code doesn't contain the information -- instead it is contained in the
header map.

If folks have other solutions they would prefer, I'm more than happy to
work on them, but this seems a reasonable way to ensure that the test in
question exercises the code it wants to exercise.

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

10 years ago[ARM64] Use %clang_cc1 consistently in the new arm64 codegen tests.
Chandler Carruth [Sun, 30 Mar 2014 13:40:57 +0000 (13:40 +0000)]
[ARM64] Use %clang_cc1 consistently in the new arm64 codegen tests.
Really, all tests outside of the Driver tree should use %clang_cc1, but
these are new and easy to fix, and many of them use buitlin headers
which don't work as well without using %clang_cc1.

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

10 years ago[PowerPC] Make -pg generate calls to _mcount not mcount
Hal Finkel [Sun, 30 Mar 2014 13:00:06 +0000 (13:00 +0000)]
[PowerPC] Make -pg generate calls to _mcount not mcount

At least on REL6 (Linux/glibc 2.12), the proper symbol for generating gprof
data is _mcount, not mcount. Prior to this change, compiling with -pg would
generate linking errors (because of unresolved references to mcount), after
this change -pg seems at least minimally functional.

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

10 years ago[Allocator] Remove forward declarations of BumpPtrAllocator. These
Chandler Carruth [Sun, 30 Mar 2014 12:05:24 +0000 (12:05 +0000)]
[Allocator] Remove forward declarations of BumpPtrAllocator. These
aren't necessary and will break when it changes to be a typedef of
a class template.

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

10 years agoSema: Implement DR317
David Majnemer [Sun, 30 Mar 2014 06:44:54 +0000 (06:44 +0000)]
Sema: Implement DR317

Summary:
Declaring a function as inline after it has been defined is in violation
of [dcl.fct.spec]p4.  The program would get a strong definition instead
of getting a function with linkonce_odr linkage.

Reviewers: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3220

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

10 years agoMS ABI: Simplify MangleByte
David Majnemer [Sun, 30 Mar 2014 06:34:26 +0000 (06:34 +0000)]
MS ABI: Simplify MangleByte

The delta between '\xe1' and '\xc1' is equivalent to the one between 'a'
and 'A'.  This allows us to reuse the computation between '\xe1' and
'\xfa' for the '\xc1' to '\xda' case.

No functionality change.

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

10 years agoTests for dr475-dr500.
Richard Smith [Sun, 30 Mar 2014 06:05:29 +0000 (06:05 +0000)]
Tests for dr475-dr500.

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

10 years agoInstall: add arm_neon.h header back
Tim Northover [Sat, 29 Mar 2014 17:35:34 +0000 (17:35 +0000)]
Install: add arm_neon.h header back

I'd gone too far pruning aarch64_simd.h this time and took out one
instance of arm_neon.h. This should restore us to the status quo.

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

10 years agoAvoid a local Twine variable.
Benjamin Kramer [Sat, 29 Mar 2014 16:54:24 +0000 (16:54 +0000)]
Avoid a local Twine variable.

Harmless in this case but potentially dangerous if it gets extended some day.

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

10 years agoARM64: Fix GCC warning in CGBuiltin.cpp
Tim Northover [Sat, 29 Mar 2014 15:26:07 +0000 (15:26 +0000)]
ARM64: Fix GCC warning in CGBuiltin.cpp

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

10 years agoRemove stray references to aarch64_simd.h
Tim Northover [Sat, 29 Mar 2014 15:21:06 +0000 (15:21 +0000)]
Remove stray references to aarch64_simd.h

They were causing the autotools builds to fail.

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

10 years agoCodeGen: Allow different RTTI emission strategies
Tim Northover [Sat, 29 Mar 2014 15:09:55 +0000 (15:09 +0000)]
CodeGen: Allow different RTTI emission strategies

Some ABIs and C++ libraries may make different trade-offs in how RTTI
is emitted (currently with respect to visibility and so on). This
implements one scheme, as used by ARM64.

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

10 years agoARM64: initial clang support commit.
Tim Northover [Sat, 29 Mar 2014 15:09:45 +0000 (15:09 +0000)]
ARM64: initial clang support commit.

This adds Clang support for the ARM64 backend. There are definitely
still some rough edges, so please bring up any issues you see with
this patch.

As with the LLVM commit though, we think it'll be more useful for
merging with AArch64 from within the tree.

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

10 years agoCodeGen: Don't crash when replacing functions
David Majnemer [Sat, 29 Mar 2014 14:19:55 +0000 (14:19 +0000)]
CodeGen: Don't crash when replacing functions

The peculiarities of C99 create scenario where an LLVM IR function
declaration may need to be replaced with a definition baring a different
type because the prototype and definition are not required to agree.

However, we were not properly deferring this when it occurred.

This fixes PR19280.

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

10 years agoARM64: parametrise IVar offset type (long on ARM64, int elsewhere).
Tim Northover [Sat, 29 Mar 2014 13:42:40 +0000 (13:42 +0000)]
ARM64: parametrise IVar offset type (long on ARM64, int elsewhere).

This is part of the ARM64 patch, but can only be tested properly when
the full codegen gets committed.

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

10 years agoObjC: allow targets to decide when to use stret for blocks.
Tim Northover [Sat, 29 Mar 2014 13:28:05 +0000 (13:28 +0000)]
ObjC: allow targets to decide when to use stret for blocks.

This was originally part of the ARM64 patch, but seems semantically
separate.

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

10 years agoDriver: implement addClangWarningOptions
Tim Northover [Sat, 29 Mar 2014 13:16:12 +0000 (13:16 +0000)]
Driver: implement addClangWarningOptions

This function allows certain platforms to enable or disable diagnostics
by default.

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

10 years ago[-Wunreachable-code] Expand paren-suppression heuristic to C++/ObjC bools.
Ted Kremenek [Sat, 29 Mar 2014 04:49:20 +0000 (04:49 +0000)]
[-Wunreachable-code] Expand paren-suppression heuristic to C++/ObjC bools.

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

10 years ago[test] Add a triple to the test.
Argyrios Kyrtzidis [Sat, 29 Mar 2014 04:05:21 +0000 (04:05 +0000)]
[test] Add a triple to the test.

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

10 years ago[test] Add a RUN line to get a hint on why the test is failing at the buildbots.
Argyrios Kyrtzidis [Sat, 29 Mar 2014 03:37:04 +0000 (03:37 +0000)]
[test] Add a RUN line to get a hint on why the test is failing at the buildbots.

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

10 years ago[HeaderSearch] Make sure we clear the mapped name from the LookupFileCacheInfo when...
Argyrios Kyrtzidis [Sat, 29 Mar 2014 03:22:54 +0000 (03:22 +0000)]
[HeaderSearch] Make sure we clear the mapped name from the LookupFileCacheInfo when we reset the start point.

rdar://16462455

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

10 years agoImprove -Wunreachable-code to provide a means to indicate code is intentionally marke...
Ted Kremenek [Sat, 29 Mar 2014 00:35:20 +0000 (00:35 +0000)]
Improve -Wunreachable-code to provide a means to indicate code is intentionally marked dead via if((0)).

Taking a hint from -Wparentheses, use an extra '()' as a sigil that
a dead condition is intentionally dead.  For example:

  if ((0)) { dead }

When this sigil is found, do not emit a dead code warning.  When the
analysis sees:

  if (0)

it suggests inserting '()' as a Fix-It.

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

10 years agoPR19278: Align ASTTemplateArgumentListInfo to match its following dynamic array
Richard Smith [Fri, 28 Mar 2014 23:32:39 +0000 (23:32 +0000)]
PR19278: Align ASTTemplateArgumentListInfo to match its following dynamic array
of TemplateArgumentLocs. 'uint64_t' has higher alignment requirements than a
pointer on some platforms.

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

10 years agoObjective-C. Make -Wselector-type-mismatch off by
Fariborz Jahanian [Fri, 28 Mar 2014 23:23:12 +0000 (23:23 +0000)]
Objective-C. Make -Wselector-type-mismatch off by
default until we provide a work-around for warning
suppression.

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

10 years ago[SemaObjC] For the semantics of the designated-initializer attribute, consider that...
Argyrios Kyrtzidis [Fri, 28 Mar 2014 22:45:38 +0000 (22:45 +0000)]
[SemaObjC] For the semantics of the designated-initializer attribute, consider that the ObjC interface of the class
includes its class extensions.

This is follow-up for rdar://16305347

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

10 years agolibclang/libIndex: USR generation: mangle source location into USRs for macros,
Dmitri Gribenko [Fri, 28 Mar 2014 22:21:26 +0000 (22:21 +0000)]
libclang/libIndex: USR generation: mangle source location into USRs for macros,
unless the macro comes from a system header

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

10 years agoReapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"
Justin Bogner [Fri, 28 Mar 2014 22:03:24 +0000 (22:03 +0000)]
Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"

Committed this by accident before it was done last time.

Original message:

    Rather than rolling our own functions to read little endian data
    from a buffer, we can use the support in llvm's Endian.h.

    No functional change.

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

10 years agoReapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"
Justin Bogner [Fri, 28 Mar 2014 22:03:19 +0000 (22:03 +0000)]
Reapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"

Committed this by accident before it was done last time.

Original message:

    Rather than rolling our own functions to write little endian data
    to an ostream, we can use the support in llvm's EndianStream.h.

    No functional change.

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

10 years agoSimplify clang-cl's target triple setting
Hans Wennborg [Fri, 28 Mar 2014 20:49:28 +0000 (20:49 +0000)]
Simplify clang-cl's target triple setting

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

10 years agoTry to fix the cl-options.c test on ARM bots
Hans Wennborg [Fri, 28 Mar 2014 20:45:05 +0000 (20:45 +0000)]
Try to fix the cl-options.c test on ARM bots

The test was failing because clang-cl changes the default triple
to target MSVC-style Win32. This is kind of wonky, but hasn't been
a problem until we started warning:

  warning: unknown platform, assuming -mfloat-abi=soft

Some of the tests in cl-options.c were running with -Werror, causing them
to fail.

Fixing this by FileCheck-ifying those tests instead of using -Werror.

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

10 years agoRevert "OnDiskHashTable: Use Endian.h to read little endian ostreams"
Justin Bogner [Fri, 28 Mar 2014 20:32:17 +0000 (20:32 +0000)]
Revert "OnDiskHashTable: Use Endian.h to read little endian ostreams"

This reverts commit r205045.

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

10 years agoRevert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"
Justin Bogner [Fri, 28 Mar 2014 20:32:11 +0000 (20:32 +0000)]
Revert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"

This reverts commit r205044.

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

10 years agoOnDiskHashTable: Use Endian.h to read little endian ostreams
Justin Bogner [Fri, 28 Mar 2014 20:04:01 +0000 (20:04 +0000)]
OnDiskHashTable: Use Endian.h to read little endian ostreams

Rather than rolling our own functions to read little endian data from
a buffer, we can use the support in llvm's Endian.h.

No functional change.

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

10 years agoOnDiskHashTable: Use EndianStream.h to write little endian ostreams
Justin Bogner [Fri, 28 Mar 2014 20:03:54 +0000 (20:03 +0000)]
OnDiskHashTable: Use EndianStream.h to write little endian ostreams

Rather than rolling our own functions to write little endian data to
an ostream, we can use the support in llvm's EndianStream.h.

No functional change.

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

10 years agoUse constexpr again, this time portably
Duncan P. N. Exon Smith [Fri, 28 Mar 2014 19:27:37 +0000 (19:27 +0000)]
Use constexpr again, this time portably

Responding to Justin's review of r205025.

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

10 years agoDocumentation: remove a spurious '1' and wrap to 80 columns
Dmitri Gribenko [Fri, 28 Mar 2014 19:25:09 +0000 (19:25 +0000)]
Documentation: remove a spurious '1' and wrap to 80 columns

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

10 years agoDocument module.private.modulemap and module_private.map.
Douglas Gregor [Fri, 28 Mar 2014 19:05:18 +0000 (19:05 +0000)]
Document module.private.modulemap and module_private.map.

Requested in <rdar://problem/16188740>.

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

10 years agoInstrProf: Fix MSVC after r205023
Duncan P. N. Exon Smith [Fri, 28 Mar 2014 18:22:26 +0000 (18:22 +0000)]
InstrProf: Fix MSVC after r205023

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

10 years agoObjective-C. revert r204965. This will make
Fariborz Jahanian [Fri, 28 Mar 2014 18:22:16 +0000 (18:22 +0000)]
Objective-C. revert r204965. This will make
-Wselector-type-mismatch default again. After
internal discussions, we think that in most cases
it has helped our developers find hard to detect
undefined behaviors. We are going to provide a syntax
(and fix-it) to suppress the warning in remaining of
false positive cases.

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

10 years agoInstrProf: Emit runtime hook directly in IRGen
Duncan P. N. Exon Smith [Fri, 28 Mar 2014 17:53:22 +0000 (17:53 +0000)]
InstrProf: Emit runtime hook directly in IRGen

-u behaviour is apparently not portable between linkers (see cfe-commits
discussions for r204379 and r205012).  I've moved the logic to IRGen,
where it should have been in the first place.

I don't have a Linux system to test this on, so it's possible this logic
*still* doesn't pull in the instrumented profiling runtime on Linux.

I'm in the process of getting tests going on the compiler-rt side
(llvm-commits "[PATCH] InstrProf: Add initial compiler-rt test").  Once
we have tests for the full flow there, the runtime logic should get a
whole lot less brittle.

<rdar://problem/16458307>

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

10 years agoRevert "Link in profile library on Linux using --whole-archive"
Duncan P. N. Exon Smith [Fri, 28 Mar 2014 17:53:17 +0000 (17:53 +0000)]
Revert "Link in profile library on Linux using --whole-archive"

This reverts commit r205012.

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

10 years agoFix a FIXME, use std::move.
Richard Smith [Fri, 28 Mar 2014 17:31:23 +0000 (17:31 +0000)]
Fix a FIXME, use std::move.

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

10 years agoLink in profile library on Linux using --whole-archive
Alexey Samsonov [Fri, 28 Mar 2014 15:39:08 +0000 (15:39 +0000)]
Link in profile library on Linux using --whole-archive

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

10 years agoclang-format: Fix aligning of comments and escaped newlines in macros.
Daniel Jasper [Fri, 28 Mar 2014 15:06:01 +0000 (15:06 +0000)]
clang-format: Fix aligning of comments and escaped newlines in macros.

Before:
  #define A      \
    int i;   /*a*/ \
    int jjj; /*b*/

After:
  #define A        \
    int i;   /*a*/ \
    int jjj; /*b*/

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

10 years agoAdd ARM big endian Target (armeb, thumbeb)
Christian Pirker [Fri, 28 Mar 2014 14:40:46 +0000 (14:40 +0000)]
Add ARM big endian Target (armeb, thumbeb)

Reviewed at http://llvm-reviews.chandlerc.com/D3096

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

10 years agoUse the correct trailing comment syntax
Dmitri Gribenko [Fri, 28 Mar 2014 10:09:39 +0000 (10:09 +0000)]
Use the correct trailing comment syntax

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

10 years agoGet rid of the adapted isLiteral method.
Manuel Klimek [Fri, 28 Mar 2014 09:27:09 +0000 (09:27 +0000)]
Get rid of the adapted isLiteral method.

We don't want to deviate from clang's standard terminology.

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

10 years agoclang-format: Recognize more ObjC blocks with parameters/return type.
Daniel Jasper [Fri, 28 Mar 2014 07:48:59 +0000 (07:48 +0000)]
clang-format: Recognize more ObjC blocks with parameters/return type.

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

10 years agoclang-cl wants MSVC-style win32
Hans Wennborg [Fri, 28 Mar 2014 01:19:04 +0000 (01:19 +0000)]
clang-cl wants MSVC-style win32

This should fix the clang-cl tests after the Windows target triple
canonicalization (r204978)

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

10 years agoUse the new Windows environment for target detection
Saleem Abdulrasool [Thu, 27 Mar 2014 22:50:18 +0000 (22:50 +0000)]
Use the new Windows environment for target detection

This follows the LLVM change to canonicalise the Windows target triple
spellings.  Rather than treating each Windows environment as a single entity,
the environments are now modelled properly as an environment.  This is a
mechanical change to convert the triple use to reflect that change.

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

10 years agoReverting r204968 and r204969; while more build bots are happy with the results,...
Aaron Ballman [Thu, 27 Mar 2014 22:37:56 +0000 (22:37 +0000)]
Reverting r204968 and r204969; while more build bots are happy with the results, some still have link errors.

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

10 years agoUrgh. Amending r204968 which somehow missed this file!
Aaron Ballman [Thu, 27 Mar 2014 22:15:55 +0000 (22:15 +0000)]
Urgh. Amending r204968 which somehow missed this file!

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

10 years agoReapplying r204952 with fixes which should hopefully resolve linking issues with...
Aaron Ballman [Thu, 27 Mar 2014 22:12:09 +0000 (22:12 +0000)]
Reapplying r204952 with fixes which should hopefully resolve linking issues with non-MSVC compilers.

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

10 years agoObjective-C. Make multiple selector warning
Fariborz Jahanian [Thu, 27 Mar 2014 21:59:01 +0000 (21:59 +0000)]
Objective-C. Make multiple selector warning
an opt-in option under -Wselector-type-mismatch.
// rdar://16445728

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

10 years agoSupport for -Wa,-compress-debug-sections.
David Blaikie [Thu, 27 Mar 2014 20:47:30 +0000 (20:47 +0000)]
Support for -Wa,-compress-debug-sections.

Also, while I'm here, support -nocompress-debug-sections too.

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

10 years agoReverting r204952, while I figure out what's going on with the makefile build.
Aaron Ballman [Thu, 27 Mar 2014 20:36:32 +0000 (20:36 +0000)]
Reverting r204952, while I figure out what's going on with the makefile build.

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

10 years agoDon't emit exit-time destructor warnings for trivial explicitly defaulted dtors
Stephan Tolksdorf [Thu, 27 Mar 2014 20:23:36 +0000 (20:23 +0000)]
Don't emit exit-time destructor warnings for trivial explicitly defaulted dtors

This commit also adds an additional test case for the global destructor warning.

Reviewed in http://llvm-reviews.chandlerc.com/D3205

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

10 years agoRecognize simple cases of trivial explicitly defaulted public dtors as irrelevant
Stephan Tolksdorf [Thu, 27 Mar 2014 20:23:12 +0000 (20:23 +0000)]
Recognize simple cases of trivial explicitly defaulted public dtors as irrelevant

Reviewed in http://llvm-reviews.chandlerc.com/D3190

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

10 years agoClean up the __has_attribute implementation without modifying its behavior.
Aaron Ballman [Thu, 27 Mar 2014 20:19:24 +0000 (20:19 +0000)]
Clean up the __has_attribute implementation without modifying its behavior.

Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes).

Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options.

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

10 years agoFix PR18307: Properly (de)serialize inherited constructors and their using declarations
Stephan Tolksdorf [Thu, 27 Mar 2014 19:22:19 +0000 (19:22 +0000)]
Fix PR18307: Properly (de)serialize inherited constructors and their using declarations

Reviewed in http://llvm-reviews.chandlerc.com/D3102

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

10 years agoImprove handling of bool expressions in template arguments.
Manuel Klimek [Thu, 27 Mar 2014 19:00:52 +0000 (19:00 +0000)]
Improve handling of bool expressions in template arguments.

Now correctly formats:
  foo<true && false>();

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

10 years agoAdd an explanatory comment and FIXME about the function declaration
Eric Christopher [Thu, 27 Mar 2014 18:50:35 +0000 (18:50 +0000)]
Add an explanatory comment and FIXME about the function declaration
for a subprogram DIE.

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

10 years agoComment parsing: use different comment styles in different test cases
Dmitri Gribenko [Thu, 27 Mar 2014 16:42:56 +0000 (16:42 +0000)]
Comment parsing: use different comment styles in different test cases

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

10 years agoComment parsing: attach comments to enums declared using the NS_ENUM macro
Dmitri Gribenko [Thu, 27 Mar 2014 16:40:51 +0000 (16:40 +0000)]
Comment parsing: attach comments to enums declared using the NS_ENUM macro

Previously we would only attach comments to the typedef.

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

10 years agoEnforce the restriction that a parameter to a kernel function
David Tweed [Thu, 27 Mar 2014 16:34:11 +0000 (16:34 +0000)]
Enforce the restriction that a parameter to a kernel function
cannot be a pointer to the private address space (as clarified
in the OpenCL 1.2 specification).

Patch by Fraser Cormack!

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

10 years agoInstrProf: Pull in runtime on non-Darwin
Duncan P. N. Exon Smith [Thu, 27 Mar 2014 16:20:02 +0000 (16:20 +0000)]
InstrProf: Pull in runtime on non-Darwin

r204379 changed the way the profile runtime gets pulled in, but missed
updating non-Darwin targets.

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

10 years agoAdd a module cache path to the test that uses -fmodules
Dmitri Gribenko [Thu, 27 Mar 2014 16:15:30 +0000 (16:15 +0000)]
Add a module cache path to the test that uses -fmodules

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

10 years agoclang-format: Avoid line-breaks that increase the current column.
Daniel Jasper [Thu, 27 Mar 2014 16:14:13 +0000 (16:14 +0000)]
clang-format: Avoid line-breaks that increase the current column.

While these might make sense for some rule (e.g. break after multi-line
operand), they generally appear ugly and confusing.

Before:
  fffffffffff(R\"x(
  multiline raw string literal xxxxxxxxxxxxxx
  )x\" + bbbbbb)

After:
  fffffffffff(R\"x(
  multiline raw string literal xxxxxxxxxxxxxx
  )x\" +
              bbbbbb)

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

10 years agoComment parsing: when comment ranges are deserialized from multiple modules,
Dmitri Gribenko [Thu, 27 Mar 2014 15:40:39 +0000 (15:40 +0000)]
Comment parsing: when comment ranges are deserialized from multiple modules,
correctly order comments in SourceManager::isBeforeInTranslationUnit() order

Unfortunately, this is not as simple as it was implemented previously, and
actually requires doing a merge sort.

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

10 years agoHandle and warn on aliases to weak aliases.
Rafael Espindola [Thu, 27 Mar 2014 15:27:20 +0000 (15:27 +0000)]
Handle and warn on aliases to weak aliases.

This produces valid IR now that llvm rejects aliases to weak aliases and warns
the user that the resolution is not changed if the weak alias is overridden.

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

10 years ago[OPENMP] OMPExecutableDirective re-factoring
Alexander Musman [Thu, 27 Mar 2014 15:14:18 +0000 (15:14 +0000)]
[OPENMP] OMPExecutableDirective re-factoring

Store the number of clauses and children of OMPExecutableDirective and dynamically compute the locations of corresponding arrays.

http://llvm-reviews.chandlerc.com/D2977

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

10 years agoclang-format: Extract getNewLineColumn out of addTokenOnNewLine.
Daniel Jasper [Thu, 27 Mar 2014 14:33:30 +0000 (14:33 +0000)]
clang-format: Extract getNewLineColumn out of addTokenOnNewLine.

No functional changes intended.

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

10 years agoFix bool expression special case.
Manuel Klimek [Thu, 27 Mar 2014 11:17:36 +0000 (11:17 +0000)]
Fix bool expression special case.

Clang-format now correctly formats:
  some_type<a * b> v;
  template <bool a, bool b> typename enabled_if<a && b>::type f() {}

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

10 years ago[cleanup] Stop specifying size overrides for BumpPtrAllocators.
Chandler Carruth [Thu, 27 Mar 2014 10:45:22 +0000 (10:45 +0000)]
[cleanup] Stop specifying size overrides for BumpPtrAllocators.

These don't seem to have any real point. Let's start with
IndexingContext. I can't come up with any conceivable reason to have
many hundereds of thousands of these alive in an address space which
would make the 4x difference in allocated (but unused) memory for the
string scratch buffer a significant memory usage problem.

The EditedSource one is somewhat more surprising. This is an 8x increase
in the memory allocated (but not used) per editted source file. However,
for this to realistically be a problem, you would need to have over half
a million editted source files in a single address space, and even that
would only really have problems on 32-bit Windows where you really only
have 2gb of virtual address space. And what's more important, the fix to
this if it is actually an issue shouldn't be to shrink the allocator's
size, it is to pass a single allocator into *many* edited source file
objects and let them share the memory.

These were the only two uses of custom sized BumpPtrAllocators
(excluding ones in the JIT using a custom allocation strategy) in all of
LLVM, Clang, LLD, LLDB, or Polly. I don't think we actually need this
complexity in the primary BumpPtrAllocator at all and am planning to
remove it.

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

10 years agoclang-format: Correctly identify ObjC Block with return type.
Daniel Jasper [Thu, 27 Mar 2014 09:43:54 +0000 (09:43 +0000)]
clang-format: Correctly identify ObjC Block with return type.

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