Commit Graph

51696 Commits

Author SHA1 Message Date
Adrian Prantl 6cdce9ed10 Adapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.
The Decl field in a DIImportedEntity is now a DIRef.
Paired commit with LLVM.

llvm-svn: 205278
2014-04-01 03:41:01 +00:00
Jordan Rose 3a176ed16d [analyzer] Lock checker: Allow pthread_mutex_init to reinitialize a destroyed lock.
Patch by Daniel Fahlgren!

llvm-svn: 205276
2014-04-01 03:40:53 +00:00
Jordan Rose 7fcaa14a82 [analyzer] Lock checker: make sure locks aren't used after being destroyed.
Patch by Daniel Fahlgren!

llvm-svn: 205275
2014-04-01 03:40:47 +00:00
Jordan Rose 0696bb4cef [analyzer] Add double-unlock detection to PthreadLockChecker.
We've decided to punt on supporting recursive locks for now; the common case
is non-recursive.

Patch by Daniel Fahlgren!

llvm-svn: 205274
2014-04-01 03:40:38 +00:00
Richard Smith 5557f6d678 Add failing testcase for DR305. Looks like we didn't implement the resolution
here in the simple-template-id case.

llvm-svn: 205273
2014-04-01 01:58:11 +00:00
Bob Wilson fc6297f314 Disable this-return optimizations when targeting iOS 5 and earlier.
Clang implements the part of the ARM ABI saying that certain functions
(e.g., constructors and destructors) return "this", but Apple's version of
gcc and llvm-gcc did not. The libstdc++ dylib on iOS 5 was built with
llvm-gcc, which means that clang cannot safely assume that code from the C++
runtime will correctly follow the ABI. It is also possible to run into this
problem when linking with other libraries built with gcc or llvm-gcc. Even
though there is no way to reliably detect that situation, it is most likely
to come up when targeting older versions of iOS. Disabling the optimization
for any code targeting iOS 5 solves the libstdc++ problem and has a reasonably
good chance of fixing the issue for other older libraries as well.
<rdar://problem/16377159>

llvm-svn: 205272
2014-04-01 01:38:16 +00:00
David Blaikie 65cbbd4ac5 Fix up compression related test cases
Fallout from r205261, ensure it doesn't matter how we disable compressed
debug info, even if zlib is missing and that we warn when we don't have
zlib and don't warn when we do, all while silently suppressing these
tests on the systems they weren't intended for...

llvm-svn: 205271
2014-04-01 00:27:28 +00:00
David Majnemer 10befcf993 MS ABI: Simplify MangleByte further
It turns out that the ranges where the '?' <letter> manglings occur are
identical to the ranges of ASCII characters OR'd with 0x80.

Thanks to Richard Smith for the insight!

No functional change.

llvm-svn: 205270
2014-04-01 00:05:57 +00:00
David Blaikie b31e1d16df Comment necessity of early initialization
Code review feedback from Eric Christopher on r204261.

I didn't want to go into too much detail (the revision history should
provide the full stuff) - but I can add more if that's preferred.

Also moved this up to right by the construction of the MCAsmInfo so
there's less chance that other things might sneak in in between.

llvm-svn: 205267
2014-03-31 23:47:13 +00:00
David Blaikie 24bbfed221 Warn when requesting compress-debug-sections and zlib is not available
Another shot in the dark, since I do have zlib installed. Will be
watching the bots for fallout.

llvm-svn: 205265
2014-03-31 23:29:38 +00:00
David Blaikie 07b8d4e6ed DebugInfo compression: Enable compression before any sections are created.
For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.

This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.

This is untestable without a cross-project test (let me know if people
would prefer that to no testing).

llvm-svn: 205261
2014-03-31 23:13:30 +00:00
Paul Robinson f067435026 Implement the 'optnone' attribute, which suppresses most optimizations
on a function.

llvm-svn: 205255
2014-03-31 22:29:15 +00:00
David Majnemer 2daf9b165e MS ABI: Add a test for Unicode literals
This adds coverage for Unicode code points which are encoded with
non-zero values in the upper half of the wchar_t.

No functionality change.

llvm-svn: 205251
2014-03-31 21:46:09 +00:00
David Majnemer e49c4b6ff2 MS ABI: Simplify endian swapping code
No functionality change.

llvm-svn: 205250
2014-03-31 21:46:05 +00:00
Richard Smith 39006cd3b8 Remove redundant template specialization that just duplicates the partial
specialization that would otherwise be selected.

llvm-svn: 205249
2014-03-31 21:31:04 +00:00
Aaron Ballman fdd783a501 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.

llvm-svn: 205234
2014-03-31 18:18:43 +00:00
Aaron Ballman b8e203939e 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.
llvm-svn: 205226
2014-03-31 17:32:39 +00:00
David Majnemer 4b293ebbaa 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.

llvm-svn: 205225
2014-03-31 17:18:53 +00:00
David Majnemer 49e5b123d7 MS ABI: Document the '\xc1' to '\xda' manglings
No functionality change.

llvm-svn: 205223
2014-03-31 17:09:09 +00:00
Benjamin Kramer 9e135ddd1d Remove unused diagnostic + dead test for it.
llvm-svn: 205220
2014-03-31 16:55:01 +00:00
David Majnemer 7b4f7d2206 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.

llvm-svn: 205218
2014-03-31 16:30:00 +00:00
David Majnemer 32b57b0a4c 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

llvm-svn: 205217
2014-03-31 16:12:47 +00:00
Tim Northover 0c68faa455 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).

llvm-svn: 205210
2014-03-31 15:47:09 +00:00
Aaron Ballman 759c71d621 Post-commit review coding style change: renaming HasAttribute to hasAttribute. No functional changes.
llvm-svn: 205201
2014-03-31 15:26:40 +00:00
Alexander Musman c0d38211f7 [OPENMP] clang-formatted include/clang/AST/StmtOpenMP.h
llvm-svn: 205199
2014-03-31 15:08:32 +00:00
Nico Rieck 8ca0bfc57f Sema: Require external linkage for dll attributes
llvm-svn: 205198
2014-03-31 14:56:58 +00:00
Nico Rieck 82f0b06749 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.

llvm-svn: 205197
2014-03-31 14:56:15 +00:00
Daniel Jasper 240dfda352 clang-format: Solve issues found and fixed by clang-tidy.
llvm-svn: 205193
2014-03-31 14:23:49 +00:00
NAKAMURA Takumi 8e5f80d2cf clang/tools/driver/Makefile: Quick fix corresponding to r205181.
llvm-svn: 205189
2014-03-31 14:11:11 +00:00
Aaron Ballman 2fbf99429a 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.

llvm-svn: 205181
2014-03-31 13:14:44 +00:00
Timur Iskhodzhanov 9ae7d3bd5f Slightly improve the readability of MicrosoftVTableContext::computeVTablePaths(). No functionality changes.
llvm-svn: 205178
2014-03-31 11:01:51 +00:00
Alexey Volkov ae43aae96a Added _rdtsc intrinsics by Robert Khasanov
Differential Revision: http://llvm-reviews.chandlerc.com/D3212

llvm-svn: 205172
2014-03-31 08:08:46 +00:00
Dmitri Gribenko f461da5306 Remove unused variable
llvm-svn: 205169
2014-03-31 07:52:35 +00:00
Tim Northover 6166ec21be ARM64: remove currently trivial switch statement
llvm-svn: 205167
2014-03-31 07:20:13 +00:00
Alexey Bataev d48bcd8a46 [OPENMP] Implemented 'copyin' clause
llvm-svn: 205164
2014-03-31 03:36:38 +00:00
Nico Weber 9ee5f9190b Add documentation for the pcs attribute, based on r129534's commit message.
llvm-svn: 205160
2014-03-30 19:45:58 +00:00
Tim Northover 65f582f432 RTTI: refactor the uniqueness question into CGCXXABI.
This also brings the code into closer conformance with usual LLVM
coding style and other surrounding conventions.

llvm-svn: 205158
2014-03-30 17:32:48 +00:00
David Majnemer 981c306e4a MS ABI: Correct typo in mangleStringLiteral
No functionality change.

llvm-svn: 205156
2014-03-30 16:38:02 +00:00
David Majnemer 8265decf46 MS ABI: Simplify mangleTemplateArgs
No functionality change.

llvm-svn: 205154
2014-03-30 16:30:54 +00:00
NAKAMURA Takumi c1e8aa06aa clang/test/Preprocessor/headermap-rel2.c: Recognize dos path.
llvm-svn: 205152
2014-03-30 15:09:08 +00:00
Chandler Carruth 705cd965e3 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.

llvm-svn: 205149
2014-03-30 14:04:32 +00:00
Chandler Carruth 1ae5a684a7 [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.

llvm-svn: 205147
2014-03-30 13:40:57 +00:00
Hal Finkel ecdb454aa7 [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.

llvm-svn: 205144
2014-03-30 13:00:06 +00:00
Chandler Carruth 379accd871 [Allocator] Remove forward declarations of BumpPtrAllocator. These
aren't necessary and will break when it changes to be a typedef of
a class template.

llvm-svn: 205142
2014-03-30 12:05:24 +00:00
David Majnemer ee4f4025c3 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

llvm-svn: 205129
2014-03-30 06:44:54 +00:00
David Majnemer 0dc714a00f 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.

llvm-svn: 205128
2014-03-30 06:34:26 +00:00
Richard Smith 6190ee65e1 Tests for dr475-dr500.
llvm-svn: 205127
2014-03-30 06:05:29 +00:00
Tim Northover fe7a445bf7 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.

llvm-svn: 205111
2014-03-29 17:35:34 +00:00
Benjamin Kramer 543c74303b Avoid a local Twine variable.
Harmless in this case but potentially dangerous if it gets extended some day.

llvm-svn: 205107
2014-03-29 16:54:24 +00:00
Tim Northover 97606edd75 ARM64: Fix GCC warning in CGBuiltin.cpp
llvm-svn: 205104
2014-03-29 15:26:07 +00:00