Commit Graph

16847 Commits

Author SHA1 Message Date
Aaron Ballman f3d9b09dea No longer triggering a checked iterator assert on Windows when using std::copy while deserializing attributed statements with more than one attribute.
llvm-svn: 208702
2014-05-13 14:55:01 +00:00
Nico Weber ad8e36c41a Support -masm= flag for x86 targets.
`clang -S -o - file.c -masm=att` will write assembly to stdout in at&t syntax
(the default), `-masm=intel` will instead output intel style asm.

llvm-svn: 208683
2014-05-13 11:11:24 +00:00
David Majnemer aeb55c9ded MS ABI: Tighten RTTI mangling
r208661 contained WIP code, commit the *actual* manglings.

llvm-svn: 208668
2014-05-13 06:57:43 +00:00
David Majnemer a96b7ee0bc MS ABI: Preliminary RTTI mangling
Implement what we currently believe is the mangling scheme for RTTI
data.  Tests will be added in a later commit which actually generate
RTTI data.

llvm-svn: 208661
2014-05-13 00:44:44 +00:00
Will Wilson eab9aa54e7 Remove unused PP variable NumIncluded
llvm-svn: 208633
2014-05-12 21:26:54 +00:00
Hans Wennborg 8bcc6400de clang-cl: accept -mllvm and -fsanitize_blacklist
llvm-svn: 208613
2014-05-12 18:59:00 +00:00
Alexey Bataev 4ca40eda36 [OPENMP] Removed unnecessary enums from OpenMP constructs
llvm-svn: 208516
2014-05-12 04:23:46 +00:00
Alp Toker a677080377 Revert "Revert "Another try at making MSVC happy again.""
This didn't work out either.

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

This reverts commit r208513.

llvm-svn: 208514
2014-05-11 23:06:26 +00:00
Alp Toker 9719e04011 Revert "Another try at making MSVC happy again."
Prospective revert to see if r208512 helped the MSVC build.

This reverts commit r208497.

llvm-svn: 208513
2014-05-11 22:12:18 +00:00
Alp Toker c7dc0621a7 Make DiagnosticsEngine non-copyable
Also provide an out-of-line dtor for CompilerInvocation.

Cleanup work that may help reduce header inclusion for IntrusiveRefCntPtr.

llvm-svn: 208512
2014-05-11 22:10:52 +00:00
Alp Toker 1b13dab608 Parameter/argument terminology fixes
llvm-svn: 208499
2014-05-11 16:06:11 +00:00
Alp Toker 4284c6e7a4 Consolidate single void paramter checking
Also correct argument/parameter terminology.

No change in functionality.

llvm-svn: 208498
2014-05-11 16:05:55 +00:00
Benjamin Kramer 53156af57c Another try at making MSVC happy again.
llvm-svn: 208497
2014-05-11 16:03:08 +00:00
Benjamin Kramer 062bf473c1 Put back raw_ostream.h include.
Some configurations of MSVC get horribly confused by the forward declaration
and explode.

llvm-svn: 208493
2014-05-11 10:41:20 +00:00
Saleem Abdulrasool 8ab3e83efa CodeGen: support dll{ex,im}port on WoA
Add ARM support for dllexport and dllimport attributes.  This is a relatively
conservative change.  The alternative is to entirely drop the architecture
requirement.  The dllimport and dllexport attributes are not restricted to any
architecture, simply to platforms that support this attribute (currently
Windows).

llvm-svn: 208486
2014-05-11 01:31:57 +00:00
Nico Weber 7aeab6022f Follow-up to r208481: Free all default arguments, not just the first one.
Also add test coverage for this case.  Found by Richard Smith!

llvm-svn: 208484
2014-05-11 00:28:16 +00:00
Benjamin Kramer ef316ee8df Try to bring the 32 bit buildbots back to life.
llvm-svn: 208482
2014-05-10 20:57:56 +00:00
Nico Weber e2b5e40203 Don't leak default arg tokens on invalid destructors or conversion functions.
Fixes PR19689, and possibly the last leak in clang (PR19521). PR19689 contains
a few suggestions on how to make the default argument token code a bit more
solid, these changes can possibly be landed in follow-ups.

llvm-svn: 208481
2014-05-10 19:23:28 +00:00
Fariborz Jahanian c70a54366e Objective-C ARC. Add support for toll-free bridge
type ,and bridge attribute, checking with static_cast. 
// rdar://16756639

llvm-svn: 208474
2014-05-10 17:40:11 +00:00
Benjamin Kramer f3ca269839 Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.
Required pulling LambdaExpr::Capture into its own header.
No functionality change.

llvm-svn: 208470
2014-05-10 16:31:55 +00:00
Richard Smith d7af8a334c Stop all the Decl classes poking at Redeclarable's data member directly, and make getNextRedeclaration follow the pattern of its friends getPreviousDecl and getMostRecentDecl.
llvm-svn: 208467
2014-05-10 01:17:36 +00:00
Reid Kleckner 37abaca3c2 MS ABI: Pass 'sret' as the second parameter of instance methods
Summary:
MSVC always passes 'sret' after 'this', unlike GCC.  This required
changing a number of places in Clang that assumed the sret parameter was
always first in LLVM IR.

This fixes win64 MSVC ABI compatibility for methods returning structs.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

llvm-svn: 208458
2014-05-09 22:46:15 +00:00
Aaron Ballman 7c192b452f Add the ability to use logical expressions for capability attributes. This is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg)
void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger)));

This is WIP code.

llvm-svn: 208439
2014-05-09 18:26:23 +00:00
Benjamin Kramer a7bcab75d2 ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.
The thread safety analysis isn't very useful in ObjC (you can't annotate
ObjC classes or methods) but we can still analyze the actual code and
show violations in usage of C/C++ functions.

Fixes PR19541, which does not use thread safety attributes but crashes
with -Weverything.

llvm-svn: 208436
2014-05-09 17:08:01 +00:00
Will Wilson eadcdbbe57 Permit duplicate explicit class instantiations if MSVCCompat is enabled
llvm-svn: 208402
2014-05-09 09:52:13 +00:00
Ismail Pazarbasi 77c456be3e Revised wording for diagnostics in r208299
llvm-svn: 208401
2014-05-09 09:49:29 +00:00
Ben Langmuir c95e56488d Switch Wmodule-build to a remark
On reflection, this is better despite the missing command-line handling
bits for remarks.  Making this a remark makes it much clearer that
this is purely informational and avoids the negative connotations of a
'warning'.

llvm-svn: 208367
2014-05-08 22:36:02 +00:00
Ben Langmuir 46b02e3edd Remove -Wnon-modular-include
But keep -Wnon-modular-include-in-[framework-]module

This warning is too noisy and doesn't really indicate a problem for most
people.  Even though it would only really affect people using
-Weverything, that seems bad so remove it.

llvm-svn: 208345
2014-05-08 18:09:29 +00:00
Diego Novillo 6dc9c4814f Fix segmentation fault when mixing -Rpass with #line.
Summary:
When using #line directives, FileManager::getFile() will return a nil
entry. This triggers an assert in translateFileLineCol().

This patch handles nil FileEntry instances by emitting a note that the
location could not be translated back to a SourceLocation. I don't
really like this solution, but we are translating presumed locations,
so some information has already been lost.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 208315
2014-05-08 13:49:54 +00:00
Karthik Bhat 967c13d3fb Fix PR19169 [Crash on invalid attempting to specialize a template method as a template variable].
A template declaration of a template name can be null in case we have a dependent name or a set of function templates.
Hence use dyn_cast_or_null instead of dyn_cast. Also improve the diagnostic emitted in this case.

llvm-svn: 208313
2014-05-08 13:16:20 +00:00
Manuel Klimek b33bded176 Explicitly keep track of temporaries during the consumed analysis.
This makes the consumed analysis less dependent on the CFG layout and fixes
a bug where we wouldn't warn on an unconsumed value.

llvm-svn: 208300
2014-05-08 11:50:00 +00:00
Ismail Pazarbasi 49ff754d4b Suggest fix-it ':' when '=' used in for-range-declaration
Fix for PR19176. Clang will suggest a fix-it hint for cases like:
  int arr[] = {1, 2, 3, 4};
  for (auto i = arr)
              ^
              :

llvm-svn: 208299
2014-05-08 11:28:25 +00:00
Nico Weber 824285ec53 Let ASTReader optionally delete its ASTDeserializationListener.
Use this to fix the leak of DeserializedDeclsDumper and DeserializedDeclsChecker
in FrontendAction (found by LSan), PR19560.

The "delete this" bool is necessary because both PCHGenerator and ASTUnit
return the same object from both getDeserializationListener() and
getASTMutationListener(), so ASTReader can't just have a unique_ptr.

It's also not possible to just let FrontendAction (or CompilerInstance) own
these listeners due to lifetime issues (see comments on PR19560).

Finally, ASTDeserializationListener can't easily be refcounted, since several of
the current listeners are allocated on the stack.

Having this bool isn't ideal, but it's a pattern that's used in other places in
the codebase too, and it seems better than leaking.

llvm-svn: 208277
2014-05-08 04:26:47 +00:00
Nikola Smiljanic e08a91ecd2 Enable alternative tokens by default for clang-format.
Patch by Bobby Moretti.

llvm-svn: 208269
2014-05-08 00:05:13 +00:00
Richard Smith 80877c228d Add an Extension warning for applying unary * to an operand of type 'void*' in
C++. This seems like a pointless (and indeed harmful) restriction to me, so
I've suggested removing it to -core and disabled this diagnostic by default.

llvm-svn: 208254
2014-05-07 21:53:27 +00:00
Richard Smith 3d23c42029 If an instantiation of a template is required to be a complete type, check
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.

llvm-svn: 208150
2014-05-07 02:25:43 +00:00
Kaelyn Takata 50c4ffcca7 Try harder to ensure a strict weak ordering of overload candidates that
have arity mismatches.

llvm-svn: 208146
2014-05-07 00:43:38 +00:00
Argyrios Kyrtzidis 37b7b2aefc Rename "secondary initializer" -> "convenience initializer" in the warnings, which is a more correct and consistent term.
llvm-svn: 208142
2014-05-06 23:24:16 +00:00
Nico Weber 5f8116ba46 Fix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.
(I tried converting StateMapsArray to a vector<unique_ptr> and changing the
types of getInfo() and addInfo() to take unique_ptrs.  This mostly worked,
except for the three-argument form of addInfo() which I found confusing enough
that I went with this simpler fix for now.)

llvm-svn: 208108
2014-05-06 17:18:03 +00:00
Jordan Rose b5d2dc2e89 Update comment for ObjCImplementationDecl's handling of instance variables.
No functionality change.

llvm-svn: 208099
2014-05-06 16:07:54 +00:00
Alexey Bataev 9959db5fa9 [OPENMP] Initial codegen for '#pragma omp parallel'
llvm-svn: 208077
2014-05-06 10:08:46 +00:00
Kevin Qin e5cee260ce [PATCH] [ARM64] Enable alignment control option in front-end for ARM64.
This patch is to get "-mno-unaligned-access" and "-munaligned-access"
work in front-end for ARM64 target.

llvm-svn: 208075
2014-05-06 09:51:32 +00:00
Craig Topper 34b4c43863 [C++11] Use 'nullptr'
llvm-svn: 208063
2014-05-06 06:48:52 +00:00
Alexey Bataev bcbadb65ab [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'
llvm-svn: 208060
2014-05-06 06:04:14 +00:00
Argyrios Kyrtzidis 26d56393c6 [Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.
Needs llvm r208007.

llvm-svn: 208008
2014-05-05 21:57:46 +00:00
Ben Langmuir 71e1a64f91 Add -Wnon-modular-include* options
Warn on non-modular includes in various contexts.

-Wnon-modular-include
 -Wnon-modular-include-in-module
  -Wnon-modular-include-in-framework-module

Where each group is a subgroup of those above it.

llvm-svn: 208004
2014-05-05 21:44:13 +00:00
Rafael Espindola 502f65ae54 Fix pr19653.
Warn if an alias requests a section other than the aliasee section.

llvm-svn: 207997
2014-05-05 20:21:03 +00:00
Alp Toker 08f6e9ec15 Fix some typos
llvm-svn: 207994
2014-05-05 19:53:42 +00:00
Ben Langmuir 1ecf750ec8 Add -Wmodule-build to make it easy to see when modules are (re)built
Warning is default ignore, and not in -Wall.

llvm-svn: 207975
2014-05-05 16:58:47 +00:00
Alp Toker a030cd0558 StringRefize and take out an old FIXME
llvm-svn: 207962
2014-05-05 12:38:48 +00:00