Commit Graph

49966 Commits

Author SHA1 Message Date
Rafael Espindola 26d0f7ce7d Use 'w' instead of 'c' to represent the win32 mangling.
This change was requested to avoid confusion if we ever support non windows
coff systems.

llvm-svn: 198939
2014-01-10 13:42:17 +00:00
Alp Toker b630b9d20a Update LangOpt descriptions
Based on recent discussions, attempt to provide a clearer distinction between
MicrosoftMode and MicrosoftExt. This still doesn't feel perfect but gives a
better idea which is which.

Also update the CPlusPlus11 description which got missed in r171367.

C++0x is dead, long live C++0x!

llvm-svn: 198936
2014-01-10 11:19:45 +00:00
Alp Toker 9765056178 TryConsume parser cleanups
Also move some comments into the block they were meant to describe.

llvm-svn: 198935
2014-01-10 11:19:30 +00:00
Daniel Jasper 4d7a97adfc clang-format: Slightly adapt line break in edge case.
Before:
  SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]
      .insert(ccccccccccccccccccccccc);

After:
  SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert(
      ccccccccccccccccccccccc);

This seems to be about 3:1 more common in Google and Chromium style and I found
only a handful of instances inside the LLVM codebase.

llvm-svn: 198924
2014-01-10 08:40:17 +00:00
Jakob Stoklund Olesen 73cb84c271 Use the right dynamic linker for SPARC Linux executables.
llvm-svn: 198923
2014-01-10 08:18:34 +00:00
Kostya Serebryany a6afef7a51 reapply r198858: Disable LeakSanitizer in TableGen binaries, see PR18325; this time LeakSanitizerIsTurnedOffForTheCurrentProcess is used instead of __lsan_is_turned_off
llvm-svn: 198922
2014-01-10 08:05:42 +00:00
Daniel Jasper b1c19f8987 clang-format: Understand ObjC boxed expressions.
Before:
  [dictionary setObject:@(1)forKey:@"number"];
After:
  [dictionary setObject:@(1) forKey:@"number"];

llvm-svn: 198920
2014-01-10 07:44:53 +00:00
Jakob Stoklund Olesen b3f938ee87 Locate GCC installations on SPARC systems.
llvm-svn: 198918
2014-01-10 06:53:02 +00:00
Richard Trieu c38786be00 Make the tautological out of range warning use Sema::DiagRuntimeBehavior so that
the warning will not trigger on code protected by compile time checks.

llvm-svn: 198913
2014-01-10 04:38:09 +00:00
Jakob Stoklund Olesen 91a8e03af0 Give the linker the right ELF type for SPARC targets.
llvm-svn: 198912
2014-01-10 03:51:33 +00:00
Jakob Stoklund Olesen 2490e553c0 Pass -32/-64 to the assembler when building for sparc/sparc64.
llvm-svn: 198911
2014-01-10 03:51:29 +00:00
Warren Hunt f4518def33 [ms-abi] Handle __declspec(align) on bitfields "properly"
__declspec(align), when applied to bitfields affects their perferred 
alignment instead of their required alignment.  We don't know why.  
Also, #pragma pack(n) turns packing *off* if n is greater than the 
pointer size.  This is now observable because of the impact of 
declspec(align) on bitfields.

llvm-svn: 198907
2014-01-10 01:28:05 +00:00
NAKAMURA Takumi ae6f9d4460 CGRecordLayoutBuilder.cpp: Clarify if-else. [-Wdangling-else]
llvm-svn: 198906
2014-01-10 00:54:50 +00:00
Fariborz Jahanian 65b1377911 ObjectiveC. 1) Warn when @dynamic (as well as synthesize)
property has the naming convention that implies 'ownership'.
2) improve on diagnostic and make it property specific.
3) fix the line number in the case of default property
synthesis. // rdar://15757510

llvm-svn: 198905
2014-01-10 00:53:48 +00:00
Richard Smith 7073a2da15 Reapply r198845, reverted in r198849, with a fix to make it valid C++98, not
just valid C++11 =)

Original commit message:

PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
SPARC, where uint64_t apparently requires higher alignment than void*.

llvm-svn: 198903
2014-01-10 00:40:45 +00:00
Warren Hunt 640015cbc3 [ms-abi] Fixing CGRecordLayoutBuilder w.r.t. MS NonVirutalBase Layout
The MS abi lays out *all* non-virtual bases with leading vfptrs before 
laying out non-virutal bases without vfptrs.  This guarantees that the 
primary base is laid out first.  r198818 fixed RecordLayoutBuilder to 
produce compatiable layouts.  This patch fixes CGRecordLayoutBuilder to 
be able to consume those layouts and produce meaningful output without 
tripping any asserts about assumed incoming layout.

A test case is included that shows CGRecordLayoutBuilder in fact 
produces output in the compatiable order.

llvm-svn: 198900
2014-01-09 23:51:31 +00:00
Aaron Ballman a4bb4b9f0b Updating documentation for the __has_attribute changes landed in r198897.
llvm-svn: 198899
2014-01-09 23:11:13 +00:00
Aaron Ballman 0fa06d879a __has_attribute now understands target-specific attributes. So when you ask whether an ARM target has the "interrupt" attribute, it will return true for ARM and MSP430 targets, and false for others.
llvm-svn: 198897
2014-01-09 22:57:44 +00:00
Aaron Ballman ab7691c4ce Removing the notion of TargetAttributesSema and replacing it with one where the parsed attributes are responsible for knowing their target-specific nature, instead of letting Sema figure it out. This is necessary so that __has_attribute can eventually determine whether a parsed attribute applies to the given target or not.
llvm-svn: 198896
2014-01-09 22:48:32 +00:00
Alp Toker 98571fd9b7 Fix ast-dump-color.cpp test following r198883
The commit added a source location that used to be missing from the AST.

llvm-svn: 198892
2014-01-09 21:43:39 +00:00
Rafael Espindola 3cc5c2df9b Use getPointerSizeInBits.
I introduced this bug in 198815. Thanks for Mark Lacey for noticing.
Unfortunately, I have no idea how to test this code.

llvm-svn: 198891
2014-01-09 21:32:51 +00:00
Ben Langmuir de04923344 Preserve -fretain-comments-from-system-headers in modules
Preserves the setting of -fretain-comments-from-system-headers when
building/saving/loading module files. This allows code completion to pick up
documentation comments from system modules.

llvm-svn: 198890
2014-01-09 20:53:49 +00:00
Ted Kremenek ce0e3f8a09 Have attribute 'objc_precise_lifetime' suppress -Wunused.
Fixes <rdar://problem/15596883>

In ARC, __attribute__((objc_precise_lifetime)) guarantees that the
object stored in it will survive to the end of the variable's formal
lifetime.  It is therefore useful even if it completely unused.

llvm-svn: 198888
2014-01-09 20:19:45 +00:00
Aaron Ballman 7c1fcf8b2c Attempting to appease the build bots on systems with ansi escape sequences.
llvm-svn: 198887
2014-01-09 20:12:12 +00:00
Alp Toker 96af9886ef Revert "Disable LeakSanitizer in TableGen binaries, see PR18325"
To declare or define reserved identifers is undefined behaviour in standard
C++. This needs to be addressed in compiler-rt before it can be used in LLVM.

See the list discussion for details.

This reverts commit r198858.

llvm-svn: 198885
2014-01-09 19:43:17 +00:00
Aaron Ballman 15b27b97b7 Removing a bit of custom parsing functionality used by the thread safety analysis APIs. Now using tablegen to determine whether an attribute's arguments should be parsed in an unevaluated context instead of relying on a separate, hard-coded list of attributes.
llvm-svn: 198883
2014-01-09 19:39:35 +00:00
Daniel Jasper 174b012524 clang-format: Add @s when breaking NSString literals.
While it is allowed to not have an @ on subsequent lines, it seems
general practice to add them. If undesired, the code author can easily
remove them again and clang-format won't re-add them.

llvm-svn: 198871
2014-01-09 14:18:12 +00:00
Daniel Jasper dc32c1bf3a clang-format: Understand #pragma mark
Before:
  #pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
  #pragma mark Any non-hyphenated or hyphenated string (including parentheses).

llvm-svn: 198870
2014-01-09 13:56:49 +00:00
Daniel Jasper 0160347b22 clang-format: Some tweaks to braces list formatting:
- Format a braced list with one element per line if it has nested
  braced lists.
- Use a column layout only when the list has 6+ elements (instead of the
  current 4+ elements).

llvm-svn: 198869
2014-01-09 13:42:56 +00:00
Pekka Jaaskelainen 3587b32e1c The OpenCL specification states that images are allocated
from the global address space (6.5.1 of the OpenCL 1.2 specification).
This makes clang construct the image arguments in the global address 
space and generate the argument metadata with the correct address space 
descriptor. 

Patch by Pedro Ferreira!

llvm-svn: 198868
2014-01-09 13:37:30 +00:00
NAKAMURA Takumi af4480a121 check-clang: Add dependencies to PrintFunctionNames and SampleAnalyzerPlugin, for r198747 and r198820.
llvm-svn: 198867
2014-01-09 13:26:02 +00:00
Kostya Serebryany bc60254543 Disable LeakSanitizer in TableGen binaries, see PR18325
llvm-svn: 198858
2014-01-09 09:26:26 +00:00
Kostya Serebryany ba4acedb69 Fix leak in lib/CodeGen/CGException.cpp, PR18318
Summary: This fixes the leak described in http://llvm.org/bugs/show_bug.cgi?id=18318

Reviewers: chandlerc, dblaikie

Reviewed By: chandlerc

CC: cfe-commits

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

llvm-svn: 198857
2014-01-09 09:22:32 +00:00
Argyrios Kyrtzidis 006a05bcac In areVectorOperandsLaxBitCastable() allow bitcast between a vector and scalar.
rdar://15779837.

llvm-svn: 198856
2014-01-09 07:58:22 +00:00
Argyrios Kyrtzidis 62a85daecd Revert "PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on"
It broke building.
This reverts commit r198845.

llvm-svn: 198849
2014-01-09 05:01:04 +00:00
Richard Smith e2f4a2744c PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
SPARC, where uint64_t apparently requires higher alignment than void*.

llvm-svn: 198845
2014-01-09 03:29:54 +00:00
Chandler Carruth 439991d7e3 Update Clang's CFGBlock interface to conform to the strange part of
LLVM's Value interface which is used in LLVM's DominatorTree analysis
and which changed in LLVM r198836.

The DominatorTree analysis is actually a generic graph analysis and
should be moved to LLVM's support library to clarify that Clang and
others are using it with arbitrary graphs. Further, it seems likely that
it should be using something other than printAsOperand, but this is
a simpler build fix. I'll clean this up later.

llvm-svn: 198840
2014-01-09 02:56:16 +00:00
David Blaikie 461f1eaaa1 Fix the clang -Werror build after r198818
llvm-svn: 198837
2014-01-09 02:34:06 +00:00
Richard Smith 83b11aae18 PR18401: Fix assert by implementing the current proposed direction of core
issue 1430. Don't allow a pack expansion to be used as an argument to an alias
template unless the corresponding parameter is a parameter pack.

llvm-svn: 198833
2014-01-09 02:22:22 +00:00
Warren Hunt b700566a3a [ms-abi] Fixed failing lit test.
This test adjustment was missing from the previous patch.

llvm-svn: 198822
2014-01-09 00:48:32 +00:00
Alp Toker 099d4ee125 Add a test for Static Analyzer checker plugins
llvm-svn: 198820
2014-01-09 00:47:40 +00:00
Warren Hunt d640d7d96e [ms-abi] Refactor Microsoft Record Layout
This patch refactors microsoft record layout to be more "natural".  The 
most dominant change is that vbptrs and vfptrs are injected after the 
fact.  This simplifies the implementation and the math for the offest 
for the first base/field after the vbptr.

llvm-svn: 198818
2014-01-09 00:30:56 +00:00
Rafael Espindola 0d84069e17 Used the DataLayout methods instead of the Module methods.
llvm-svn: 198815
2014-01-09 00:17:51 +00:00
Alp Toker bb4b86af83 Implement isCXX11FinalKeyword() in terms of isCXX11VirtSpecifier()
It's not worth keeping two copies of the identifier init and comparison code
just to save a pointer coparison.

This should reduce further once we get proper contextual keywords in the token
stream, so having the identifier checks in one place is a step towards that.

Cleanup only.

llvm-svn: 198814
2014-01-09 00:13:52 +00:00
Aaron Ballman 8c7817ebb1 Attempting a fix the build bots should be happier with. Amends 198804.
llvm-svn: 198805
2014-01-08 23:26:53 +00:00
Aaron Ballman 199a78935e Silencing an MSVC warning about control reaching the end of a non-void function.
llvm-svn: 198804
2014-01-08 23:08:41 +00:00
Alp Toker d839c82ac9 Ensure that ENABLE_SHARED is substituted for use in Windows builds
We (perhaps over-cautiously) disable the new plugin tests on static Windows
builds right now, matching what LLVM core does. This change was needed for the
lit check to work.

Thanks to Warren Hunt for spotting this.

llvm-svn: 198782
2014-01-08 20:06:24 +00:00
Argyrios Kyrtzidis 9308f0ae80 [Serialization] In ASTReader::getInputFile record it when we didn't find the file to avoid looking it up again.
Hopefully addresses rdar://14514222.

llvm-svn: 198781
2014-01-08 19:13:34 +00:00
Jordan Rose 656fdd55dd [analyzer] Warn about double-delete in C++ at the second delete...
...rather somewhere in the destructor when we try to access something and
realize the object has already been deleted. This is necessary because
the destructor is processed before the 'delete' itself.

Patch by Karthik Bhat!

llvm-svn: 198779
2014-01-08 18:46:55 +00:00
Benjamin Kramer e21cb74224 clang-format: Don't hang forever when encountering a stray "}" in an @implementation block.
PR18406.

llvm-svn: 198770
2014-01-08 15:59:42 +00:00