Граф коммитов

23095 Коммитов

Автор SHA1 Сообщение Дата
Rafael Espindola 5df37bd024 Delay checking of typedefs of dependent types. Fixes PR11630.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147281 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 22:42:47 +00:00
Benjamin Kramer a11d309862 Fix potential use after free.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 14:18:37 +00:00
NAKAMURA Takumi b5409c5bbf clang/lib/Headers/CMakeLists.txt: Unbreak cmake build to add bmi2intrin.h since r147275.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 03:20:06 +00:00
Craig Topper f58f3647b1 Add BMI2 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147275 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 02:31:10 +00:00
Richard Smith dd4b350143 Fix constexpr handling to allow 'extern constexpr' variable declarations. We no
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 21:17:58 +00:00
Richard Smith eba05b2e39 constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 20:00:17 +00:00
NAKAMURA Takumi 6ab9f02ca0 lib/Headers/CMakeLists.txt: Fix cmake build since r147263, for two missing headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 12:47:46 +00:00
Craig Topper 0b269c1f36 Add the rest of the BMI intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 07:27:12 +00:00
Craig Topper 5c75208a5b Add intrinsics for lzcnt and tzcnt instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 06:25:37 +00:00
Craig Topper 31ceea0965 Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 05:06:45 +00:00
Rafael Espindola 8d2a701734 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147260 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 01:18:52 +00:00
Richard Smith b701d3d0b2 Always implicitly declare move assignment operations for dynamic classes, in
case they override virtual functions from a base class. Also fix -print-stats
counting of move assignment/construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147258 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 21:56:24 +00:00
Craig Topper 5cbd751a2f Add last of the AVX2 intrinsics except for gather.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 17:20:15 +00:00
Craig Topper 34a1da4354 Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 07:55:14 +00:00
Craig Topper ee9b41d154 Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 05:19:29 +00:00
Craig Topper 7f16caa3c0 Intrinsics for AVX2 unpack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:58:43 +00:00
Craig Topper cbe627b54e More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-24 03:28:57 +00:00
Nico Weber ff91d240d4 Fix several issues related to specializations and explicit instantiations.
Explicit instantiations following specializations are no-ops and hence have
no PointOfInstantiation. That was done correctly in most cases, but for a
specialization -> instantiation decl -> instantiation definition chain, the
definition didn't realize that it was a no-op. Fix that.

Also, when printing diagnostics for these no-ops, get the diag location from
the decl name location.

Add many test cases, one of them not yet passing (but it failed the same way
before this change). Fixes http://llvm.org/pr11558 and more.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 20:58:04 +00:00
Anton Yartsev 17ba267cae fix for PR11634
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 20:23:19 +00:00
Benjamin Kramer 430cf51d4a Give C11's __STDC_VERSION__ the final value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 17:00:41 +00:00
Benjamin Kramer ffbe9b9c64 Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 17:00:35 +00:00
Craig Topper 28a324a30b Add AVX2 multiply intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 08:31:16 +00:00
Dylan Noblesmith 8fdb6dee2d Let CompilerInvocation initialization indicate failure
This fixes the FIXMEs in ParseAnalyzeArgs. (Also a
precursor to moving the analyzer into an AST plugin.)

For consistency, do the same with AssemblerInvocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 03:05:38 +00:00
Argyrios Kyrtzidis 9241057266 Pass context and access to Parser::ParseExplicitInstantiation() for
good parser error recovery and for not crashing.

We still have a accepts-invalid-code bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 02:16:45 +00:00
Fariborz Jahanian 712ef87453 objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:31:02 +00:00
Douglas Gregor 224bfeeaf0 Remove spurious, but now legal, typename
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:27:08 +00:00
Douglas Gregor 585ec93e1b When building a module with an umbrella header, warn about any headers
found within that umbrella directory that were not actually included
by the umbrella header. They should either be referenced in the module
map or included by the umbrella header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 00:23:59 +00:00
Ted Kremenek 682060c5d9 Colorize and condense CFG pretty-printing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 23:33:52 +00:00
Nico Weber 5cb94a7820 Add -Wdangling-else.
This works like described in  http://drdobbs.com/blogs/cpp/231602010
Fixes http://llvm.org/PR11609



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 23:26:17 +00:00
Dylan Noblesmith 1770e0dadc remove unneeded config.h includes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 22:49:47 +00:00
Douglas Gregor bf1739c10a Make a note for an optimization that I'd like to implement, when the ASTs for local externs are sound
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 22:05:07 +00:00
Douglas Gregor c3cfd2ab33 Serialize the AST reader's mapping from canonical declarations to the
set of (previously-canonical) declaration IDs to the module file, so
that future AST reader instances that load the module know which
declarations are merged. This is important in the fairly tricky case
where a declaration of an entity, e.g.,

  @class X;

occurs before the import of a module that also declares that
entity. We merge the declarations, and record the fact that the
declaration of X loaded from the module was merged into the (now
canonical) declaration of X that we parsed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 21:40:42 +00:00
Nick Lewycky b0c6c33c34 Fix build under -Wswitch by adding support for FK_ListConstructorOverloadFailed
to initialization sequence dumping.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 20:21:32 +00:00
Douglas Gregor cce54aa6a4 If we end up merging an Objective-C class with an existing Objective-C
class that comes from a different module file, make sure that we load
all of the pending declarations for the original declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:44:59 +00:00
Kevin Enderby 567003e572 Last part of support for generating dwarf for assembly source files. This gets
the clang driver to enable this when assembling a .s file.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:31:58 +00:00
Sebastian Redl cf15cef844 Overloading for initializer list construction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 18:58:38 +00:00
Sebastian Redl 62f13c9e9e Fix a parser bug that prevented it from correctly parsing explicit construct expressoins of the form T{args}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 18:58:29 +00:00
Sebastian Redl 10f04a6267 List-initialization via constructor part 1. Still needs: pretty-printing, overloading, initializer_list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 14:44:04 +00:00
Craig Topper 231f793326 Add AVX2 intrinsics for max, min, sign extend, and zero extend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 09:18:58 +00:00
Ted Kremenek b7dcddf182 Fix typos in analyzer diagnostics pointed out by Matt Beaumont-Gay and Robert Purves.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 06:35:52 +00:00
Argyrios Kyrtzidis 04a94bcc56 In Lexer::getCharAndSizeSlow[NoWarn] if we come up against
\<newline><newline>

don't consume the second newline.

Thanks to David Blaikie for pointing out the crash!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 04:38:07 +00:00
Eli Friedman e6a24e83e7 Add support for bitcasts to vector type in Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 03:51:45 +00:00
Richard Smith 6180245e9f PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 02:22:31 +00:00
Douglas Gregor 0f75323264 When deserializing an Objective-C class, check whether we have another
declaration of that same class that either came from some other module
or occurred in the translation unit loading the module. In this case,
we need to merge the two redeclaration chains immediately so that all
such declarations have the same canonical declaration in the resulting
AST (even though they don't in the module files we've imported).

Focusing on Objective-C classes until I'm happy with the design, then
I'll both (1) extend this notion to other kinds of declarations, and
(2) optimize away this extra checking when we're not dealing with
modules. For now, doing this checking for PCH files/preambles gives us
better testing coverage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:48:48 +00:00
Ted Kremenek 15ce164836 Enhance AnalysisDeclContext::getReferencedBlockVars() to understand PseudoObjExprs. It turns out
that the information collected by this method is a super set of the captured variables in BlockDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:30:46 +00:00
Richard Smith 974c5f93d0 PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 01:07:19 +00:00
Ted Kremenek 280cf1451b Fix regression in LiveVariables when reasoning about variables captured by blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:46:32 +00:00
Eli Friedman 58c65fcb90 Fix a failure (which led to a crash) in constant emission code with vector compound literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 00:04:00 +00:00
Argyrios Kyrtzidis f132dcaae8 In Lexer::getCharAndSizeSlow[NoWarn] make sure we don't go over the end of the buffer
when the end of the buffer is immediately after an escaped newline.

Fixes http://llvm.org/PR10153.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 20:19:55 +00:00
Fariborz Jahanian 97bbab2df7 objc, objc rewriter. Fixes couple of bugs one
because of recent refactoring and one in the
rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:48:07 +00:00
Ted Kremenek 3b7a48fbc6 Improve CFG pretty-printing for CXXConstructExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:39:59 +00:00
Matt Beaumont-Gay aa5d533427 Cast enumerators from different anonymous enums to unsigned, to appease gcc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:36:37 +00:00
Ted Kremenek 893d414534 Improve CFG pretty-printing of CastExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:32:38 +00:00
Argyrios Kyrtzidis cee5ec9df4 Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 16:56:35 +00:00
Argyrios Kyrtzidis d7711ec430 For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 16:56:29 +00:00
Douglas Gregor 87dd4f7f43 Implement a trivial, obvious optimization for deserialization of
redeclaration chains: only ever have the reader search for
redeclarations of the first (canonical) declaration, since we only
ever record redeclaration ranges for the that declaration. Searching
for redeclarations of non-canonical declarations will never find
anything, so it's a complete waste of time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 15:12:03 +00:00
Craig Topper 4a4f25a5a8 Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:35:05 +00:00
Craig Topper 318e460ada Add AVX2 horizontal add/sub intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 08:17:40 +00:00
Richard Smith 7098cbd601 constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 05:04:46 +00:00
Nick Lewycky 9bddf4324a Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don't
actually know about the other OSes on X86-32 besides Linux...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 04:25:47 +00:00
Richard Smith 1d238ea926 C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
 - variables of reference type
 - constexpr variables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 02:55:12 +00:00
Eli Friedman 6bd9719fd9 Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:43:02 +00:00
Richard Smith 3e9ea0b8cd C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:25:33 +00:00
Fariborz Jahanian 28441e6cee objc QOI: Don't't warn about mismatch between attributes
on method declaration and definition if former is in
a system header. // rdar://10580333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147020 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 00:09:11 +00:00
Richard Smith a44854a23b PR11297: Provide a better diagnostic for code which contains a
reasonable-looking but ill-formed for-range statement of the form:

  for (expression : expression)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:56:20 +00:00
Anna Zaks 2cbe791d3e [analyzer] Do not invalidate arguments when the parameter's
type is a pointer to const. (radar://10595327)

The regions corresponding to the pointer and reference arguments to
a function get invalidated by the calls since a function call can
possibly modify the pointed to data. With this change, we are not going
to invalidate the data if the argument is a pointer to const. This
change makes the analyzer more optimistic in reporting errors.
(Support for C, C++ and Obj C)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:35:30 +00:00
Fariborz Jahanian b5ea9db3cf objc/c++: Issue diagnostic when free-standing ivar is accessed
in class method instead of crash. // rdar://10593227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146998 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:21:08 +00:00
Douglas Gregor 1d4c1137c3 When we make a previously-deserialized module definition visible,
notify the AST deserialization listener so that the AST writer knows
that it can write the macro definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:06:13 +00:00
Ted Kremenek 6ae325737c Fix inversion of static analyzer path diagnostics for path conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 22:00:25 +00:00
Nico Weber c7feca0392 Fix a crash on invalid, http://llvm.org/pr11599
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 20:32:49 +00:00
Douglas Gregor 2ccd89cff3 When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 18:11:52 +00:00
Douglas Gregor e7aa27a826 When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 15:50:13 +00:00
Craig Topper 4c07c5dfeb Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 09:55:26 +00:00
Chandler Carruth 3ff53b3587 Update the CMake build for r146959's new files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 08:42:15 +00:00
Richard Smith 2fbf373a56 Fix off-by-one error in an assert condition. No functionality change, but better
error detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 04:39:57 +00:00
Richard Smith b6f8d28411 Revert r146766, and add a testcase for which it introduced a wrong-code bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 04:00:21 +00:00
David Blaikie 99ba9e3bd7 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:48:34 +00:00
Richard Smith f6702a3927 Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Split out a new ExpressionEvaluationContext flag for this case, and don't treat
it as unevaluated in C++11. This fixes some crash-on-invalids where we would
allow references to class members in potentially-evaluated constant expressions
in static member functions, and also fixes half of PR10177.

The fix to PR10177 exposed a case where template instantiation failed to provide
a source location for a diagnostic, so TreeTransform has been tweaked to supply
source locations when transforming a type. The source location is still not very
good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to
improve it further.

Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for
static data members of class templates which are used in constant expressions.
This fixes a link-time problem, but we still incorrectly treat the member as
non-constant. The rest of the fix for that issue is blocked on PCH support for
early-instantiated static data members, which will be added in a subsequent
patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:08:33 +00:00
Eli Friedman 9490ab433d Fix tentative parsing so it knows how to handle an ambiguous for-range-declaration. PR11601.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 01:50:37 +00:00
Ted Kremenek d9d12e0c0b Refine error diagnostic for using bridged casts when not using ARC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 01:03:40 +00:00
Douglas Gregor 305dc3ebaa Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because
that header wasn't parsed. In such cases, complain (because the
module's umbrella headers don't cover everything) and fall back to
including the header.

Later, we'll add a warning at module-build time to catch all such
cases. However, this fallback is important to eliminate assertions in
the ASTWriter when this happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 00:28:52 +00:00
Bill Wendling 6446c3e360 Mark the calls to the _setjmp function as returns twice. <rdar://problem/10492556>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 23:53:28 +00:00
Eli Friedman d71f44266a Switch a few callers of MakeAddrLValue places over to MakeNaturalAlignAddrLValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 23:03:09 +00:00
Fariborz Jahanian e2eb0e9973 objc-arc: bridge casts in non-arc mode are now
error. // rdar://10597832


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:52:53 +00:00
Richard Smith bc6abe93a5 Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:12:41 +00:00
Richard Smith af2c7a1945 Improve r146813 (for PR11595) to give an appropriate diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 22:01:37 +00:00
Chris Lattner 4cac9e169b Fix PR5279 - don't sliently drop alignment information on stores of types that have alignment less than the natural alignment of the type when it comes from a typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:16:08 +00:00
Douglas Gregor a126651270 Eliminate the first->last redeclaration map from the AST file
format. It's no longer being used, now that we have a new
implementation of redeclaration chains.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:09:25 +00:00
Fariborz Jahanian 00852e4126 objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:06:15 +00:00
Douglas Gregor 21cf08b7e0 Remove ASTReader's PendingForwardRefs, which is now handled by the
(more general) fix-up of definition data pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 20:51:16 +00:00
Douglas Gregor fc529f7fca Once we have fully deserialized a redeclaration chain for something
with a definition pointer (e.g., C++ and Objective-C classes), zip
through the redeclaration chain to make sure that all of the
declarations point to the definition data. 

As part of this, realized again why the first redeclaration of an
entity in a file is important, and brought back that idea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 19:00:47 +00:00
Douglas Gregor f63b0a5f54 Re-implement (de-)serialization of redeclaration chains for
redeclaration templates (RedeclarableTemplateDecl), similarly to the
way (de-)serialization is implemented for Redeclarable<T>. In the
process, found a simpler formulation for handling redeclaration
chains and implemented that in both places.

The new test establishes that we're building the redeclaration chains
properly. However, the FIXME indicates where we're tickling a
different bug that has to do with us not setting the DefinitionData
pointer properly in redeclarations that we detected after the
definition itself was deserialized. The (separable) fix for that bug
is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 18:19:24 +00:00
Douglas Gregor adafc2edc0 The submodule offset map can introduce "empty" remapping entries for
imported modules that don't introduce any new entities of a particular
kind. Allow these entries to be replaced with entries for another
loaded module.

In the included test case, selectors exhibit this behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 16:14:14 +00:00
Douglas Gregor ecb19382e1 Optimize serialized representation of redeclarable declarations for
which there are no redeclarations. This reduced by size of the PCH
file for Cocoa.h by ~650k: ~536k of that was in the new
LOCAL_REDECLARATIONS table, which went from a ridiculous 540k down to
an acceptable 3.5k, while the rest was due to the more compact
abbreviated representation of redeclarable declaration kinds (which no
longer need to store the 'first' declaration ID).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 15:27:36 +00:00
Rafael Espindola bcf6b98247 Extend the fix for PR9614 to handle inline asm in the outer decl and
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 14:41:01 +00:00
Douglas Gregor 0f45682b46 Combine common (de-)serialization logic for typedefs and type aliases
into operations on TypedefNameDecl. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 14:40:25 +00:00
Craig Topper 735ceaa4cc Add AVX2 intrinsics for and, andn, or, and xor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 09:03:48 +00:00
Dylan Noblesmith 098eaffc0c SourceManager: use getBufferSize()
Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146861 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 08:51:05 +00:00
Craig Topper 9c2ffd803a More AVX2 intrinsic support including saturating add/sub and palignr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146857 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 07:03:25 +00:00
Richard Smith 099e7f647c constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

  extern const int a;
  const int n = a;
  const int a = 5;
  int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 06:19:21 +00:00
Craig Topper 925be547b1 Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146855 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 05:04:33 +00:00
Benjamin Kramer 85c60db213 Silence gcc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-18 12:18:02 +00:00
Richard Smith 2116b144cf PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-18 02:33:09 +00:00
Douglas Gregor a1be278c4f Completely re-implement (de-)serialization of declaration
chains. The previous implementation relied heavily on the declaration
chain being stored as a (circular) linked list on disk, as it is in
memory. However, when deserializing from multiple modules, the
different chains could get mixed up, leading to broken declaration chains.

The new solution keeps track of the first and last declarations in the
chain for each module file. When we load a declaration, we search all
of the module files for redeclarations of that declaration, then
splice together all of the lists into a coherent whole (along with any
redeclarations that were actually parsed). 

As a drive-by fix, (de-)serialize the redeclaration chains of
TypedefNameDecls, which had somehow gotten missed previously. Add a
test of this serialization.

This new scheme creates a redeclaration table that is fairly large in
the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The
table is mmap'd in and searched via a binary search, but it's still
quite large. A future tweak will eliminate entries for declarations
that have no redeclarations anywhere, and should
drastically reduce the size of this table.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146841 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 23:38:30 +00:00
Chandler Carruth 79cbbdc8af Split the Windows toolchain definition into its own file. This is
especially nice as the Windows toolchain needs the windows header files,
and has lots of platform specific hooks in it.

To facilitate the split, hoist a bunch of file-level static helpers into
class-level static helpers. Spiff up their doxygen comments while there
as they're now more likely to be looked up via docs.

Hopefully, this will be followed by further breaking apart of the
toolchain definitions. Most of the large and complex ones should likely
live on their own. I'm looking at you Darwin. ;]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 23:10:01 +00:00
Chandler Carruth 657849c603 Fix an abiguous-else warning from GCC. I have no idea why Clang doesn't
have this warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146839 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 22:32:42 +00:00
Ted Kremenek 22d141452d Update CMake dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 20:08:54 +00:00
Craig Topper 2b03bb0314 Add -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 19:55:21 +00:00
NAKAMURA Takumi ad646846f7 Frontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.
It had been causing test "Misc/diag-verify.cpp" failure on ms cl.exe. The emission was ordered unexpectedly as below;

First)  error: 'error' diagnostics seen but not expected:
Second) error: 'error' diagnostics expected but not seen:

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 13:00:31 +00:00
Argyrios Kyrtzidis 917078386b [PCH] Don't deserialize bodies of interesting decls while iterating
over them because more interesting decls can be added during body
deserialization.

Should fix msvc build tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 08:11:25 +00:00
Ted Kremenek 2a76410c0a Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This gives us comparative diagnostics
to TextDiagnosticPrinter.

This certainly can be cleaned up a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 05:26:11 +00:00
Ted Kremenek 2898d4f764 Refactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
the policy of how diagnostics are lowered/rendered, while TextDiagnostic handles
the actual pretty-printing.

This is a first part of reworking SerializedDiagnosticPrinter to use the same
inclusion-stack/macro-expansion logic as TextDiagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146819 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 05:26:04 +00:00
Argyrios Kyrtzidis 373cb78320 [PCH] Fix bug where we failed to update an identifier for a single token
macro expansion.

rdar://10588825

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 04:13:31 +00:00
Argyrios Kyrtzidis 71168330e2 [PCH] In ASTReader::FinishedDeserializing fully load the interesting decls,
including deserializing their bodies, so that any other declarations that
get referenced in the body will be fully deserialized by the time we pass them to the consumer.

Could not reduce to a test case unfortunately. rdar://10587158.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146817 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 04:13:28 +00:00
Argyrios Kyrtzidis 0db9f4dad5 In Parser::SkipUntil do not stop at '@' unconditionally.
Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context
when doing parser recovery, but we should not stop at all '@' tokens because they may be part
of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them.

This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to
recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery
from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@'
in an expression).

The case that rdar://7029784 is about still passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 04:13:22 +00:00
Argyrios Kyrtzidis a24195aaf7 After late parsing an objc method, make sure there are no leftover cached tokens,
because the memory associated with them is going to get released.
We also don't want them to affect later parsing.
(We do the same for C++ inline methods.)

The underlying cause for the leftover tokens is going to be addressed in the
next commit.

Couldn't get a test case for the crash though. rdar://10583033.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 04:13:18 +00:00
Eli Friedman f59ff8c777 Add a missing check before trying to evaluate a temporary. PR11595.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146813 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 02:24:21 +00:00
Chad Rosier d7dd7755fc Fix _mm_permute_ps and _mm256_permute_ps AVX intrinsics to use "I" (ICE)
markings.  Fix avxintrin.h to take them into account.
Part of rdar://10595450

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 01:51:05 +00:00
Chad Rosier c17f88efa2 Revert r146797, which was a partial revert of r146791; It was correct in the
first place.  The permutevar_* (note the *var*) intrinsics use ymm/mem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146807 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 01:39:56 +00:00
Chad Rosier 1e4faf56cd Fix _mm256_extractf128_* AVX intrinsics to use "I" (ICE) markings. Fix
avxintrin.h to take them into account.
Part of rdar://10595450


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 01:22:27 +00:00
Chad Rosier 197808762d Partial revert of r146791; vpermilps/vpermilpd instructions accepts ymm/mem/imm8.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:50:42 +00:00
Eli Friedman fc038e9ef8 Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:36:09 +00:00
Anna Zaks 9ffbe243cc [analyzer] Add support for taint flowing through a function (atoi).
Check if the input parameters are tainted (or point to tainted data) on
a checkPreStmt<CallExpr>. If the output should be tainted, record it in
the state. On post visit (checkPostStmt<CallExpr>), use the state to
make decisions (in addition to the existing logic). Use this logic for
atoi and fscanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:26:34 +00:00
Anna Zaks 777d706547 [analyzer] Minor: Simplify & assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:26:29 +00:00
Chad Rosier b8786c4dc4 Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to take them into 
account.
Part of rdar://10595450


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:15:26 +00:00
Eric Christopher 973bbb6a8a When in a limited debug information situation if we can find the original
declaration for the type then go ahead and use that, it's still smaller
than creating an all new derived type.

Part of rdar://10335756 and others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 23:40:18 +00:00
Eric Christopher 435e106f94 Start down the path of getting clang to internally agree on structs versus
classes.

Part of rdar://10520586 and a couple others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 23:40:14 +00:00
Nicola Gigante 8a93d27a50 Fix an inconsistency in the syntactic form of InitListExpr in case of initialization that involves a ConstructorConversion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146766 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:57:37 +00:00
Richard Smith a3ca4d6559 Don't allow #include (and its friends #import, #include_next and
#__include_macros) in the arguments of a function-style macro. Directives in the
arguments of such macros have undefined behaviour, and GCC does not correctly
support these cases. In some situations, this can lead to better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:50:01 +00:00
Douglas Gregor fd002a7027 Make sure we're always setting the previous declaration of an ObjCInterfaceDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:37:11 +00:00
Nick Lewycky 7ec59c78f1 Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146762 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:34:14 +00:00
Nick Lewycky 9952070fa2 Fix 80-column violation and whitespace. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:32:39 +00:00
Eli Friedman d9ce41e19d Add missing flush call. This is an attempt to fix a broken Windows buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:12:23 +00:00
Chad Rosier b95ddf15e7 Fix vinsertf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10590282


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 21:40:31 +00:00
Chad Rosier c5cda1121e Fix vperm2f128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10576962


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146757 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 21:07:34 +00:00
Richard Smith 25b009a9d2 PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 19:31:14 +00:00
Richard Smith 08d6e032a2 C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 19:06:07 +00:00
Anna Zaks d3d8548e75 [analyzer] Better stdin support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 18:28:50 +00:00
Anna Zaks 0e818a412f Fixup to the relaxed diagnostic verification option r146633.
We should exit when matching the '+' even if nothing was found to
prevent searching for all UNIT_MAX items.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 18:28:45 +00:00
Douglas Gregor 8d2dbbf9dd If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146740 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 16:34:57 +00:00
David Blaikie 91ec7894ec Support decltype in pseudo destructors and dependent destructor calls.
Reviewed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 16:03:09 +00:00
Fariborz Jahanian 6b65d4a9cc objc: after issuing the warning on direct use of __attribute__((NSObject))
on properties, prevent consequential error  diagnostics. // rdar://10591336


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146737 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 15:54:29 +00:00
Douglas Gregor 0af550115d Fix chaining of ObjCInterfaceDecl redeclarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146722 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 03:12:41 +00:00
Sean Callanan bd79119a50 Sema::RequireCompleteType currently attempts to
instantiate a class from its template pattern
before it consults the ExternalASTSource.  LLDB
in particular will sometimes provide patterns
that need to be completed first.

To make this possible, I have moved the
completion before the code that does the
instantiation, allowing the ExternalASTSource
to provide the required information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 00:20:31 +00:00
Argyrios Kyrtzidis 99ee085101 In SourceManager::~SourceManager do a sanity check to make sure we
don't try to destruct a null ContentCache.

rdar://10567159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 23:37:55 +00:00
Douglas Gregor 7c1f1f1582 When generating debug info for an ObjCInterfaceDecl, try to dig out the definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 23:32:29 +00:00
Douglas Gregor 05c272fed8 Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 22:34:59 +00:00
Anna Zaks bcb3b981da [analyzer] Address Jordy's comments for r145985.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 21:33:26 +00:00
Douglas Gregor d63348c338 When name lookup finds a module-private Objective-C class declaration,
check whether any previous declarations of the class were visible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:36:27 +00:00
Douglas Gregor 7723fec9b4 Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:29:51 +00:00
Richard Smith 018887209f Refactor and simplify AddInitializerToDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 19:20:59 +00:00
Douglas Gregor 26fec63b14 Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:17:27 +00:00
Douglas Gregor 53df7a1d34 Introduce the core infrastructure needed to model a complete
redeclaration chain for Objective-C classes, including:
  - Using the first declaration as the canonical declaration.
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and the definition knows that it is the definition.
  - Serialization support for when a definition gets added to a
  declaration that comes from an AST file.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCInterfaceDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:03:09 +00:00
Douglas Gregor dec1cc4ec7 Two null Decl*'s don't refer to the same declaration, because they
don't refer to anything. Amusingly, we were relying on this in one
place. Thanks to Chandler for noticing the weirdness in
declaresSameEntity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 17:15:07 +00:00
Hans Wennborg d02deebce5 Support the 'a' length modifier in scanf format strings as a C90
extension.

This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 10:25:47 +00:00
Argyrios Kyrtzidis 53ba95612c Revert r146646 that was a mistake, and make the intended change in the right file.
Log:
[libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:53:37 +00:00
Argyrios Kyrtzidis f5a684d774 [libclang] Try to unbreak mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:48:43 +00:00
Douglas Gregor 2e5c15be82 Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:27:12 +00:00
Eli Friedman 4bf34d19b8 <climits> has UINT_MAX, not <limits>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:24:37 +00:00
Anna Zaks 676bb5ad76 Another fixit for r146633 (to make debian-fnt bot happy), try including limits instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 03:27:51 +00:00
Anna Zaks c035e09b6f Fixit for r146633. Make sure UINT_MAX is defined on all platforms.
(Attempt to turn debian-fnt buildbot back to green.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 02:58:00 +00:00
Eli Friedman b17ee5bff0 Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield. PR11572.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 02:41:52 +00:00
Anna Zaks 2135ebb831 Add support for matching one or more (aka regex +) diagnostic messages with -verify.
Ex:
// expected-warning + {{tainted}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 02:28:16 +00:00
Eli Friedman 62d829abaf gcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 02:15:56 +00:00
Anna Zaks 557a3829eb [analyzer] Ensure that the order in which checker callbacks are called
is deterministic.

Non-determinism was the reason for the test which caused the earlier
buildbot failures, so re-enable the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146628 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 01:36:04 +00:00
Fariborz Jahanian f8aba8c618 objc: do not auto synthesize properties declared in
protocols; with a warning. // rdar://10567333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 01:03:18 +00:00
Douglas Gregor 5e3a8bea1c In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146622 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:53:32 +00:00
Richard Trieu 2fe9b7fb07 Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared.  If either is a substring of the other, then
no error is given.  This gives rise to an unexpected case:

  // expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

  candidate function has different number of parameters (expected 1 but has 2)
  candidate function has different number of parameters

It will also match these other error messages:

  candidate function
  function has different number of parameters
  number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting.  Also, all the failing tests from this
change have been corrected.  Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:38:15 +00:00
Douglas Gregor 60ef308e51 Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:29:59 +00:00
Richard Smith daaefc5381 Produce more detailed diagnostics when static_assert condition is not an ICE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146607 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 23:32:26 +00:00
Rafael Espindola a2a178989b Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 21:50:24 +00:00
Douglas Gregor d3d0853311 Don't consider an overloaded operator& when the expression is actually
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146587 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 21:23:13 +00:00
Rafael Espindola 6af27ec695 Don't use the frame pointer on linux x86 and x86_64 if optimizing. This
matches gcc's behavior.

Fixes PR8186.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146586 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 21:02:23 +00:00
DeLesley Hutchins 4805f15820 Allow empty argument lists in thread safety attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146580 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 19:36:06 +00:00
David Blaikie 76178ed091 Move & comment the 'decltype in declarator-id' as suggested by Doug Gregor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 18:59:02 +00:00
Bob Wilson 0d57ca1449 Fix obvious error in _mm_test_all_zeros. PR11565.
Patch by Mathias Gaunard!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 17:17:16 +00:00
Douglas Gregor af764723bf Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 17:12:03 +00:00
Douglas Gregor 553689148f When name lookup comes across a declaration that is in a module that
is not visible, look for any previous declarations of that entity that
might be visible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146563 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 16:03:29 +00:00
Matt Beaumont-Gay 80fb7dd8e0 r146430 lost some compile-time performance on MultiSource/Benchmarks/MiBench/security-rijndael; this gets most of it back.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146562 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 16:02:15 +00:00
Bob Wilson dfba0278ce Enable stack protectors by default for iOS. <rdar://problem/8836680>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146552 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 06:08:25 +00:00
Anna Zaks efd6989f46 [analyzer] Treat stdin as a source of taint.
Some of the test cases do not currently work because the analyzer core
does not seem to call checkers for pre/post DeclRefExpr visits.
(Opened radar://10573500. To be fixed later on.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:56:18 +00:00
Anna Zaks 28fd98d66d [analyzer] Minor refactor to addTaint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:56:15 +00:00
Anna Zaks 1009ac7155 [analyzer] Mark output of fscanf and fopen as tainted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:56:02 +00:00
Anna Zaks e55a22b917 [analyzer] Mark getenv output as tainted.
Also, allow adding taint to a region (not only a symbolic value).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:55:58 +00:00
Chad Rosier 9f6d068b29 Per discussion on the list, remove BitcodeVerify pass to reimplement as a free function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 00:29:23 +00:00
Richard Trieu a6dc7eff27 Make the diagnostic message more consistant. Update the type comparison to
handle non-pointer types.  This is for the extra info printed when function
types are compared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 23:19:45 +00:00
Fariborz Jahanian 7209646add objc: diagnose duplicate declaration of methods
in classes. // rdar://10535349


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 19:40:34 +00:00
Abramo Bagnara fea966a410 Added an assertion about overflow in sizeof evaluation. This does not solve the underlying structural issue that is waiting for a proper solution.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146482 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 11:23:52 +00:00
David Blaikie df512bfbc4 Disallow decltype in qualified declarator-ids.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 08:03:36 +00:00
Richard Smith c1c5f27c64 Add checks and diagnostics for many of the cases which C++11 considers to not
be constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146479 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 06:39:58 +00:00
Douglas Gregor 3cee31e4d7 Set umbrella directory correctly when we infer a framework module
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:55:05 +00:00
Nick Lewycky db103cc925 Fix "control may reach end of non-void function" warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146448 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:36:07 +00:00
Francois Pichet 9d24a8be93 Implement the Microsoft __if_exists/if_not_exists extension in initializer-list.
Necessary to parse Microsoft ATL code.

Example: 
  int array[] = {
    0, 
    __if_exists(CLASS::Type) {2, }
    3
  };

will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146447 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:24:39 +00:00
Douglas Gregor bab9f4afae Tweak submodule ID handling in the AST writer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146445 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:17:57 +00:00
Fariborz Jahanian ba96ffcb2a objc-arc: better diagnostic when block is declared
inside a struct/union.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146444 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:17:04 +00:00
Eli Friedman fa2b3dd31c Make CGRecordLayoutBuilder correctly switch over to a packed class when a class has a base whose alignment will break the class layout. <rdar://problem/10551376>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:13:20 +00:00
Chad Rosier ff7892758f Add frontend flags to enable bitcode verifier pass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146441 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 23:05:47 +00:00
Matt Beaumont-Gay 8ef8f431aa Suppress -Warray-bounds in certain cases involving macros from system headers.
The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 22:35:02 +00:00
Fariborz Jahanian 364a59ed8f Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 21:16:36 +00:00
Tony Linthicum 9631939f82 Hexagon backend support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 21:14:55 +00:00