Commit Graph

25156 Commits

Author SHA1 Message Date
Bill Wendling 1e60a2c287 Add a flag to the image info section indicating that the program is compiled for
a simulator.

llvm-svn: 155436
2012-04-24 11:04:57 +00:00
Evgeniy Stepanov 582911a089 Only pass -mcpu, -march, -mfpu to linux-as on ARM.
llvm-svn: 155431
2012-04-24 09:05:31 +00:00
Kostya Serebryany 5dd2cfc81e enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing
llvm-svn: 155430
2012-04-24 06:57:01 +00:00
Chandler Carruth ff90611253 Fix a typo spotted by Matt.
llvm-svn: 155427
2012-04-24 05:59:48 +00:00
Richard Smith 2cc2b46683 Don't try to delay parsing the exception specification for a data member of a
class; we would never actually parse it and attach it to the type.

llvm-svn: 155426
2012-04-24 05:48:42 +00:00
Chandler Carruth 3dfb6d84c6 Introduce an initial sketch of a MSVC compatible 'intrin.h' builtin
header, along with a stub test to make sure it compiles in the
appropriate modes.

Thanks to Aaron Ballman for working with me to figure out the initial
strategy here, and to Nico for reviewing and pestering me to actually
commit it.

llvm-svn: 155425
2012-04-24 05:23:54 +00:00
Richard Smith 4e42bc8365 PR12629: Cope with parenthesized function types when attaching a delayed
exception specification to a function.

llvm-svn: 155424
2012-04-24 05:06:35 +00:00
Fariborz Jahanian 08a1eb77c5 with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232

llvm-svn: 155385
2012-04-23 20:30:52 +00:00
Eric Christopher 3cc207bbcc Forward declarations should take a context. This helps the debugger
find forward declarations in the context that the actual definition
will occur.

rdar://11291658

llvm-svn: 155381
2012-04-23 19:00:24 +00:00
DeLesley Hutchins e09be231fa Thread safety analysis: support the use of pt_guarded_by attributes
on smart pointers.  Also adds test case for previous commit.

llvm-svn: 155379
2012-04-23 18:39:55 +00:00
Chandler Carruth 70ac923ebc Revert r155363, due to the underlying patches in LLVM causing regression
test suite failures.

llvm-svn: 155371
2012-04-23 18:25:40 +00:00
Rafael Espindola b522a5f246 Fix visibility when we have two types with explicit visibility in a template
argument list.

llvm-svn: 155368
2012-04-23 17:51:55 +00:00
Sirish Pande 7039d0eaee Hexagon V5 (floating point) support in cfe.
llvm-svn: 155363
2012-04-23 17:48:57 +00:00
DeLesley Hutchins 70b5e8eefc Thread-safety analysis: support new "pointer to member" syntax for
existentially quantified lock expressions.

llvm-svn: 155357
2012-04-23 16:45:01 +00:00
Douglas Gregor 39f39ff4b7 Teach RequireCompleteType about multi-dimensional arrays. Fixes
<rdar://problem/11284902>.

llvm-svn: 155356
2012-04-23 16:42:52 +00:00
Rafael Espindola d88f37b8be Inline helper function into only caller.
llvm-svn: 155352
2012-04-23 14:27:47 +00:00
Benjamin Kramer e499345e34 Sema: Initialize NSString method cache members.
Found by valgrind.

llvm-svn: 155324
2012-04-22 20:43:35 +00:00
Benjamin Kramer 5c17f9cb71 Remove unnecessary StringRef->char*->StringRef conversion, which read uninitialized memory if the input wasn't 0-terminated.
Found by valgrind.

llvm-svn: 155323
2012-04-22 20:43:30 +00:00
Rafael Espindola bbc5cbc410 An attribute in a explicit template installation should take precedence over
the tempale arguments in deciding the visibility.

This agrees with gcc 4.7.

Found by trying to build chrome with component=shared_library with 155314
reverted.

llvm-svn: 155316
2012-04-22 15:31:59 +00:00
Richard Smith f3c37e89a1 PR12571: Objects of type clang::ConstantArrayType aren't always emitted with
type llvm::ArrayType -- sometimes we emit them as packed structs. Don't assert
if such a global array has an element type with a non-trivial destructor.

llvm-svn: 155305
2012-04-22 05:51:36 +00:00
Richard Smith e85e176600 PR12585: When processing a friend template inside a class template, don't
pretend there was no previous declaration -- that can lead us to injecting
a class template (with no access specifier) into a class scope. Instead,
just avoid the problematic checks.

llvm-svn: 155303
2012-04-22 02:13:50 +00:00
Rafael Espindola 8add48ec9e Fix handling of template parameters. Found by inspection. GCC 4.7 agrees
with this testcase.

llvm-svn: 155301
2012-04-22 00:43:48 +00:00
Rafael Espindola 46cb6f1b51 All the members of LVFlags always have the same value, replace the class with
a boolean.

llvm-svn: 155299
2012-04-21 23:28:21 +00:00
Richard Smith 84973e56e3 Fix regression in r154844. If necessary, defer computing adjusted destructor
exception specifications in C++11 until after we've parsed the exception
specifications for nested classes.

llvm-svn: 155293
2012-04-21 18:42:51 +00:00
Fariborz Jahanian a53e5d79fc Remove unneeded code.
llvm-svn: 155290
2012-04-21 17:51:44 +00:00
Richard Smith 8b987a9976 Fix serialization of uninstantiated exception specifications. Patch by Li Kan,
test by me.

llvm-svn: 155289
2012-04-21 17:47:47 +00:00
Nuno Lopes 9af6b0350c move some stuff to .rodata
llvm-svn: 155282
2012-04-21 14:45:25 +00:00
NAKAMURA Takumi 40edb2a0fb SemaDeclCXX.cpp: Fix utf8 in comment.
llvm-svn: 155279
2012-04-21 09:40:04 +00:00
Matt Beaumont-Gay 025321b7e4 Also highlight the member name.
llvm-svn: 155274
2012-04-21 02:13:04 +00:00
Richard Smith 6483d22f1b When declaring a template, check that the context doesn't already contain a
declaration of the same name. r155187 caused us to miss this if the prior
declaration did not declare a type.

llvm-svn: 155269
2012-04-21 01:27:54 +00:00
Matt Beaumont-Gay d9f244afbb Fix a QoI bug reported by a user.
Set the source location for the "member reference base type ... is not a
structure or union" diag to point at the operator rather than the member name.
If we're giving this diagnostic because of a typo'd '.' in place of a ';' at
the end of a line, the caret previously pointed at the identifier on the
following line, which isn't as helpful as it could be. Pointing the caret at
the '.' makes it more obvious what the problem is.

llvm-svn: 155267
2012-04-21 01:12:48 +00:00
Bob Wilson 7dda0cdcd7 Link with Foundation whenever -fobjc-link-runtime is used. <rdar://10976177>
The check for excluding libarclite on i386 MacOSX should not apply to
Foundation.

llvm-svn: 155263
2012-04-21 00:21:42 +00:00
Fariborz Jahanian 344d65c248 objective-c arc: With currnt documentation,
objc_returns_inner_pointer attribute can be applied to
methods only. Diagnsose otherwise, instead of
crashing. // rdar://11253688

llvm-svn: 155245
2012-04-20 22:00:46 +00:00
Anna Zaks 7e53bd6fb0 [analyzer] Run remove dead bindings right before leaving a function.
This is needed to ensure that we always report issues in the correct
function. For example, leaks are identified when we call remove dead
bindings. In order to make sure we report a callee's leak in the callee,
we have to run the operation in the callee's context.

This change required quite a bit of infrastructure work since:
 - We used to only run remove dead bindings before a given statement;
here we need to run it after the last statement in the function. For
this, we added additional Program Point and special mode in the
SymbolReaper to remove all symbols in context lower than the current
one.
 - The call exit operation turned into a sequence of nodes, which are
now guarded by CallExitBegin and CallExitEnd nodes for clarity and
convenience.

(Sorry for the long diff.)

llvm-svn: 155244
2012-04-20 21:59:08 +00:00
Chad Rosier 5b58af0381 In r135308, -save-temps was modified to prevent a temporary file from
overwriting the input file.  For example,

clang -c foo.s -o foo.o -save-temps

Unfortunately, the original patch didn't compare the paths of the input and
output files.  Thus, something like the following would fail to create foo.s.

cd /tmp/obj
clang -c ../src/foo.s -o foo.o -save-temps

rdar://11252615

llvm-svn: 155224
2012-04-20 20:05:08 +00:00
Richard Smith 83c478d389 Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).

llvm-svn: 155218
2012-04-20 18:46:14 +00:00
Chad Rosier 232150b90a When generating the clang crash diagnostic script, strip out the -o flag.
Add a FIXME comment.
rdar://11283560

llvm-svn: 155207
2012-04-20 17:21:42 +00:00
Chad Rosier 681e4b8d96 Add a little hack to emulate a clang crash, so the diagnostics generator can be
tested.

llvm-svn: 155205
2012-04-20 17:08:59 +00:00
Evgeniy Stepanov ed943f66d6 Pass -mfloat-abi= to linuxtools assembler.
llvm-svn: 155191
2012-04-20 09:03:40 +00:00
Timur Iskhodzhanov f32a377a7c Fix bug 12574 - Avoid infinite recursion in constructors and destructors when using Microsoft C++ ABI
llvm-svn: 155189
2012-04-20 08:05:00 +00:00
Richard Smith 61e582f6bc Replace r155185 with a better fix, which also addresses PR12557. When looking
up an elaborated type specifier in a friend declaration, only look for type
declarations, per [basic.lookup.elab]p2. If we know that the redeclaration
lookup for a friend class template in a dependent context finds a non-template,
don't delay the diagnostic to instantiation time.

llvm-svn: 155187
2012-04-20 07:12:26 +00:00
Richard Smith a7f57e3aca Fix a bug which creduce found reducing PR12585.
llvm-svn: 155185
2012-04-20 05:42:36 +00:00
Chad Rosier 9c74e4310c When generating the clang crash diagnostic script, strip out the -D, -F, and -I
flags.  We have preprocessed source, so we don't need these.

No test case as it's fairly difficult to make the compiler crash on demand.  I'll
patiently wait for Ben to tell me how to do this in 2 lines of code.  :)
rdar://11283560

llvm-svn: 155180
2012-04-20 00:30:04 +00:00
Fariborz Jahanian d155c78d18 objective-arc: Retune my previous patch so warning
is issued on weak property as receiver and not on
any other use of a weak property. // rdar://10225276

llvm-svn: 155169
2012-04-19 23:49:39 +00:00
Kaelyn Uhrain b3967d7fdc In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
followed by an identifier as declaration specificer (except for ObjC).
This allows e.g. an out-of-line C++ member function definitions to be
recognized as functions and not as variable declarations if the type
name for the first parameter is not recognized as a type--say, when there
is a function name shadowing an enum type name and the parameter is
missing the "enum" keyword needed to distinguish the two.

Note that returning TPResult::Error() instead of TPResult::True()
appears to have the same end result, while TPResult::Ambiguous()
results in a crash.

llvm-svn: 155163
2012-04-19 23:17:45 +00:00
Fariborz Jahanian fce89c609d objective-c arc: Issue warning under -Wreceiver-is-weak
if receiver is a 'weak' property, by type or by attribute.
// rdar://10225276

llvm-svn: 155159
2012-04-19 21:44:57 +00:00
DeLesley Hutchins 8c9d9579c4 Refactor the thread safety analysis so that it is easier to do
path-sensitive analysis like handling of trylock expressions.

llvm-svn: 155137
2012-04-19 16:48:43 +00:00
Fariborz Jahanian df0577de11 objective-c modern translator: Further improving the last
patch fixing writing a spurious 'static' into
the wrong place. // rdar://11275241

llvm-svn: 155130
2012-04-19 16:30:28 +00:00
DeLesley Hutchins 8d11c797b2 Thread safety analysis: split warnings into two groups: attribute warnings
which are checked in the parser, and analysis warnings that require the
full analysis.  This allows attribute syntax to be checked independently
of the full thread safety analysis.  Also introduces a new warning for the
case where a string is used as a lock expression; this allows the analysis
to gracefully handle expressions that would otherwise cause a parse error.

llvm-svn: 155129
2012-04-19 16:10:44 +00:00
Francois Pichet 52d3898a11 Fix a comment.
llvm-svn: 155107
2012-04-19 07:48:57 +00:00
Richard Smith 2b349aee5b Add missing -Wc++98-compat warnings for initializer list initializations which
initialize references, create std::initializer_list objects, or call constructors.

llvm-svn: 155105
2012-04-19 06:58:00 +00:00
Rafael Espindola 53cf219367 In mergeVisibility, if we already have an explicit visibility, keep it.
This fixes the included testcase and lets us simplify the code a bit. It
does require using mergeWithMin when merging class information to its
members. Expand the comments to explain why that works.

llvm-svn: 155103
2012-04-19 05:50:08 +00:00
Rafael Espindola 1f073336b7 Now that we check visibility attributes in an appropriate order,
there is no need for mergeVisibily to ever increase the visibility. Not
doing so lets us replace an incorrect use of mergeVisibilityWithMin. The
testcase

struct HIDDEN RECT {
  int top;
};
DEFAULT RECT foo = {0};

shows that we should give preference to one of the attributes instead of
keeping the minimum. We still get this testcase wrong because mergeVisibily
handles two explicit visibilities incorrectly, but this is a step in the
right direction.

llvm-svn: 155101
2012-04-19 05:24:05 +00:00
Rafael Espindola b660efd57a Check ConsiderGlobalVisibility before using -fvisibility.
llvm-svn: 155100
2012-04-19 04:37:16 +00:00
Rafael Espindola 3d3d339357 The explicit bit in LV already tracks exactly the same information as
DHasExplicitVisibility. Simplify the code a bit.

llvm-svn: 155099
2012-04-19 04:27:47 +00:00
Rafael Espindola af690f509a Move the point in the code where we handle -fvisibility=hidden. With
the current implementation this should be a nop as explicit visibility
takes precedence in mergeVisibility.

The location chosen is such that attributes checked above it can force
a symbol to be default. For example, an attribute is the variable or function.
Attributes checked after this point, can only make the visibility more
restrictive. An attribute in a type for example.

llvm-svn: 155098
2012-04-19 02:55:01 +00:00
Rafael Espindola 7a5543dbff Make setVisibility private and change users to mergeVisibility. This is
currently a nop as those users are the first merge or are a merge
of a hidden explicit visibility, which always wins in the current
implementation.

llvm-svn: 155095
2012-04-19 02:22:07 +00:00
Fariborz Jahanian ca357d9831 modern objective-c translator: Fix writing a spurious 'static'
into the wrong place when rewriting a static function
which declares block literals. // rdar://11275241

llvm-svn: 155084
2012-04-19 00:50:01 +00:00
Patrick Beard 0caa39474b Implements boxed expressions for Objective-C. <rdar://problem/10194391>
llvm-svn: 155082
2012-04-19 00:25:12 +00:00
Richard Smith d372942d77 PR 12586: Fix assert while running libc++ testsuite: deal with exception
specifications on member function templates of class templates and other such
nested beasties. Store the function template from which we are to instantiate
an exception specification rather than trying to deduce it. Plus some
additional test cases.

llvm-svn: 155076
2012-04-19 00:08:28 +00:00
Chandler Carruth b8ae76037a Revert some Hexagon builtin commits to match reverts done to LLVM in
r155047. See the LLVM log for the primary motivation:
  http://llvm.org/viewvc/llvm-project?rev=155047&view=rev

Primary commit r154828:
  - Several issues were raised in review, and fixed in subsequent
    commits.
  - Follow-up commits also reverted, and which should be folded into the
    original before reposting:
    - r154837: Re-add the 'undef BUILTIN' thing to fix the build.
    - r154928: Fix build warnings, re-add (and correct) header and
      license
    - r154937: Typo fix.

Please resubmit this patch with the relevant LLVM resubmission.

llvm-svn: 155048
2012-04-18 21:32:25 +00:00
Fariborz Jahanian b525b52987 objective-c: Issue diagnostic when an implicit
property accessor (getter) missing, instead of crashing.
// rdar://11273060

llvm-svn: 155036
2012-04-18 19:13:23 +00:00
Matt Beaumont-Gay 69e227b7b1 Suppress -Wunused-variable warning in -Asserts build
llvm-svn: 155011
2012-04-18 17:25:16 +00:00
Benjamin Kramer 33adaae564 VerifyICE: Pass PartialDiagnostics by reference.
llvm-svn: 155005
2012-04-18 14:22:41 +00:00
Simon Atanasyan 296a7bb49f MIPS: Followup to r154606. Expand list of accepted MIPS target features in the MipsTargetInfoBase::setFeatureEnabled() routine.
llvm-svn: 154998
2012-04-18 12:00:11 +00:00
Gabor Greif 5d3231cecb fix GCC version comparison wrt. equal patch suffices (and squash two typos)
llvm-svn: 154997
2012-04-18 10:59:08 +00:00
Manuel Klimek ff26efceb4 Adds a FixedCompilationDatabase to be able to specify tool parameters
at the command line.

llvm-svn: 154989
2012-04-18 07:41:50 +00:00
Francois Pichet 5b061f0156 As per John McCall comment:
Follow up to r154924: check that we are in a static CMethodDecl to enable the Microsoft bug emulation regarding access to protected member during PTM creation. Not just any static function.

llvm-svn: 154982
2012-04-18 03:24:38 +00:00
Seth Cantrell 01d61b0ae4 fix display of source lines with null characters
llvm-svn: 154981
2012-04-18 02:44:48 +00:00
Seth Cantrell 99e2fa87f8 Nicer display of unprintable source, and fix caret display for non-ascii text
Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

llvm-svn: 154980
2012-04-18 02:44:46 +00:00
Rafael Espindola 12b785e8bb Calling setVisibility directly only makes (some) sense when the visibility is
explicit.

llvm-svn: 154969
2012-04-18 00:14:58 +00:00
Richard Smith 79a52e5709 PR12569: Instantiate exception specifications of explicit instantiations
and explicit specializations of function templates appropriately.

llvm-svn: 154956
2012-04-17 22:30:01 +00:00
Seth Cantrell 14dc87fccc Revert "Nicer display of unprintable source, and fix caret display for non-ascii text"
This reverts commit e9a3b76ba589a8a884e978273beaed0d97cf9861.

Revert "fix display of source lines with null characters"

This reverts commit 70712b276e40bbe11e5063dfc7e82ce3209929cd.

llvm-svn: 154950
2012-04-17 20:59:59 +00:00
Seth Cantrell f504f99c7d fix display of source lines with null characters
llvm-svn: 154947
2012-04-17 20:06:06 +00:00
Seth Cantrell fae205811e Nicer display of unprintable source, and fix caret display for non-ascii text
Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

llvm-svn: 154946
2012-04-17 20:06:03 +00:00
Rafael Espindola 2dd5ed5e5f Simplify calls to mergeVisibility* by passing in the LinkageInfo. No
functionality change.

llvm-svn: 154940
2012-04-17 18:47:20 +00:00
Fariborz Jahanian 88773764e9 objective-c modern translation. Correct rewriting of
block meta-data of block literals declared inside
of extern "C" functions.
// rdar://1131490

llvm-svn: 154939
2012-04-17 18:40:53 +00:00
Manuel Klimek 40636c9986 Switches the JSONCompilationDatabase to use the YAML parser.
This will allow us to delete the JSON parser from llvm.

The biggest change is a general change of strategy - instead
of storing StringRef's to the values for the command line and
directory in the input buffer, we store ScalarNode*'s. The
reason is that the YAML parser's getRawValue on ScalarNodes
returns a string that includes the quotes in case of double
quoted strings.

For the same reason we're removing the JSON parsing part of
the command line parsing - this means an extra copy for a
command line when it is requested (and only when it is requested).

llvm-svn: 154929
2012-04-17 16:54:26 +00:00
Francois Pichet a39371c0e2 Emulate a MSVC bug where the creation of pointer-to-member to protected member of base class is allowed but only from a static function.
This fixes a regression when parsing MFC code with clang.

llvm-svn: 154924
2012-04-17 12:35:05 +00:00
Gabor Greif 8a45d57a1d fix a typo
llvm-svn: 154920
2012-04-17 11:16:26 +00:00
Craig Topper 26e74e50b6 Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortunately, these instructions have behavior that can't be modeled with shuffle vector.
llvm-svn: 154906
2012-04-17 05:16:56 +00:00
Ted Kremenek 92e27e0900 Change ExprEngine::shouldInlineDecl() to be defensive in checking if the CFG of the callee is valid. Fixes <rdar://problem/11257631>.
llvm-svn: 154896
2012-04-17 01:36:03 +00:00
Chad Rosier 1e303eefaf Fix case where the alignment is overaligned, per Eli's suggestion.
rdar://11220251

llvm-svn: 154893
2012-04-17 01:14:29 +00:00
Richard Smith f623c96260 Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.
We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.

llvm-svn: 154886
2012-04-17 00:58:00 +00:00
Chad Rosier a750d46c9f Make sure EmitMoveFromReturnSlot is passing the correct alignment to
EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment).
rdar://11220251

llvm-svn: 154883
2012-04-17 00:35:38 +00:00
Eric Christopher 365e309ccb Typo.
llvm-svn: 154880
2012-04-16 23:55:04 +00:00
Fariborz Jahanian 35f6e12bf0 Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664

llvm-svn: 154876
2012-04-16 23:00:57 +00:00
Fariborz Jahanian cc1722818b modern objective-c translator: translation of implicit
cast to/from block pointer types. // rdar://11202764
Also, many more modern translator tests.

llvm-svn: 154869
2012-04-16 22:14:01 +00:00
Anna Zaks 51244c22be [analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Along with it, fix a couple of other corner cases and add more tests.

llvm-svn: 154866
2012-04-16 21:51:09 +00:00
Fariborz Jahanian 29898f4565 objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426. 

llvm-svn: 154861
2012-04-16 21:03:30 +00:00
Duncan Sands 54c05faade Remove support for -fast-math metadata for the moment.
llvm-svn: 154851
2012-04-16 19:40:49 +00:00
Eli Friedman 2f5b7c542e Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.
llvm-svn: 154849
2012-04-16 19:23:57 +00:00
Rafael Espindola 78158af59c Revert r154749 for now at John McCall's request.
llvm-svn: 154846
2012-04-16 18:46:26 +00:00
Douglas Gregor 433e05306f Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.

llvm-svn: 154844
2012-04-16 18:27:27 +00:00
Rafael Espindola 505a7c818d Use ordering and the explicit visibility bit instead of modifying
ConsiderGlobalVisibility. No functionality change.

llvm-svn: 154843
2012-04-16 18:25:01 +00:00
Duncan Sands 8030b810de Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet.

llvm-svn: 154835
2012-04-16 17:24:31 +00:00
Sirish Pande f02eebef2a Hexagon V5(Floating Point) support.
llvm-svn: 154828
2012-04-16 17:04:05 +00:00
Duncan Sands 65229ed99a Adjust for LLVM name tweaks requested by Chandler.
llvm-svn: 154824
2012-04-16 16:29:47 +00:00
Rafael Espindola 9d2874033d Add another constructor to LVFlags and use it to simplify the code a bit.
llvm-svn: 154814
2012-04-16 13:44:41 +00:00
Douglas Gregor 3024f07c12 Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type. 

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.

llvm-svn: 154799
2012-04-16 07:05:22 +00:00
Eli Friedman 6c31cb4d8d Make constant evaluation for pointer comparisons work correctly for some uncommon cases. <rdar://problem/10962435>.
llvm-svn: 154794
2012-04-16 04:30:08 +00:00
Sebastian Pop 980920a321 use DEFAULT_SYSROOT
llvm-svn: 154792
2012-04-16 04:16:43 +00:00
Francois Pichet 0066db9039 The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
   error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };

llvm-svn: 154790
2012-04-16 04:08:35 +00:00
Eli Friedman 7f1ff60021 Propagate alignment on lvalues through EmitLValueForField. PR12395.
llvm-svn: 154789
2012-04-16 03:54:45 +00:00
Nick Lewycky 2bd0ab2b11 Implement the all_lookups_iterator for PCH as a follow-up to r153970. This
includes a patch from Matthias Kleine with a regression testcase!

Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to
reconstruct the external_key from the internal_key, which is useful for traits
that don't store enough information to do that mapping in their key. Also
deletes the 'item_iterator' from OnDiskHashTable as dead code.

llvm-svn: 154784
2012-04-16 02:51:46 +00:00
Craig Topper 8e57855ea0 Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code.
llvm-svn: 154777
2012-04-15 22:18:10 +00:00
David Blaikie 6f9f4ebc9f Correct indentation
llvm-svn: 154774
2012-04-15 21:22:10 +00:00
Duncan Sands c720e78ebc Use MDBuilder to help with metadata creation.
llvm-svn: 154767
2012-04-15 18:04:54 +00:00
Benjamin Kramer 89f0b2d8a2 Use forward declarations for ASTDeclContextNameLookupTable and add a missing delete.
It would be nice to use OwningPtr here, but DeclContextInfo is stored in a DenseMap.

llvm-svn: 154763
2012-04-15 12:36:49 +00:00
Benjamin Kramer ccdf735e52 Actually, this tree isn't necessarily binary.
llvm-svn: 154762
2012-04-15 11:35:18 +00:00
Benjamin Kramer c2a4475caa Recursively delete rewrite rope nodes when tearing down the tree.
llvm-svn: 154760
2012-04-15 11:09:40 +00:00
Richard Smith 9ec1e48b59 PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like  i8 ptrtoint ([n x i8]* @str to i8).

llvm-svn: 154756
2012-04-15 02:50:59 +00:00
Fariborz Jahanian 1b085428e8 objective-c modern translator: Make metadata
definition for protocols static. // rdar://11248048

llvm-svn: 154753
2012-04-14 17:13:08 +00:00
Rafael Espindola 0aec8ece52 Consider visibility attributes last, so that they take precedence.
I am working on a cleaner fix, but this gets the case in PR12552 passing.

llvm-svn: 154749
2012-04-14 15:21:19 +00:00
Benjamin Kramer e298063669 Replace manual delete[] with OwningArrayPtr.
llvm-svn: 154748
2012-04-14 14:13:43 +00:00
Benjamin Kramer 1d1d2d289a Don't leak vtable thunks.
llvm-svn: 154747
2012-04-14 13:21:23 +00:00
Benjamin Kramer bafc49a89c Delete late parsed attributes instead of leaking them.
llvm-svn: 154746
2012-04-14 12:44:47 +00:00
Duncan Sands 6fc461984a Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
thinking of generalizing it to be able to specify other freedoms beyond accuracy
(such as that NaN's don't have to be respected).  I'd like the 3.1 release (the
first one with this metadata) to have the more generic name already rather than
having to auto-upgrade it in 3.2.

llvm-svn: 154745
2012-04-14 12:37:26 +00:00
Benjamin Kramer 1e6b6060f9 Parser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.
Instead, make it the allocation function's responsibility to add them
to a list and clear it when a top-level decl is finished.

This plugs leakage of TemplateAnnotationIds. DelayedCleanupPool is
ugly and unused, remove it.

llvm-svn: 154743
2012-04-14 12:14:03 +00:00
Benjamin Kramer ffe7c7f4b2 ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.
llvm-svn: 154739
2012-04-14 09:11:56 +00:00
Benjamin Kramer 73faad6409 Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual deletion.
llvm-svn: 154736
2012-04-14 08:26:28 +00:00
Richard Smith c202b2809a Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!

llvm-svn: 154723
2012-04-14 00:33:13 +00:00
Benjamin Kramer ac9b31a404 Delete the TypoResultsMap when erasing the pointer to it.
This manual deleting is error-prone, but we can't just put an OwningPtr in a
std::map :(

llvm-svn: 154707
2012-04-13 23:09:10 +00:00
John McCall 8c38d35b05 Don't enter cleanups for unreachable variables. It's impossible to
jump into these scopes, and the cleanup-entering code sometimes wants
to do some operations first (e.g. a GEP), which can leave us with
unparented IR.

llvm-svn: 154684
2012-04-13 18:44:05 +00:00
Fariborz Jahanian 3a5d552cd7 modern objective-c translator: Fixes translation of
__typeof which is a regression by reverting
r154360. // rdar://11233924

llvm-svn: 154679
2012-04-13 18:00:54 +00:00
Benjamin Kramer 6d3f11142d Avoid string thrashing when we can concatenate them in the final buffer.
llvm-svn: 154678
2012-04-13 18:00:37 +00:00
John McCall cf6ce28f71 Serialize and deserialize some missing bits from BlockDecl.
llvm-svn: 154676
2012-04-13 17:33:29 +00:00
Douglas Gregor 0481c8f206 Remove the unused, unmaintained, incomplete 'Index' library.
llvm-svn: 154672
2012-04-13 16:31:46 +00:00
Fariborz Jahanian 4af0e9efdd modern objective-c translator: When translating
call to 'super' use __rw_objc_super as type of the
'super' meta-data instead of objc_super.
// rdar://11239894

llvm-svn: 154670
2012-04-13 16:20:05 +00:00
Douglas Gregor aa0df2d373 Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs
llvm-svn: 154669
2012-04-13 16:05:42 +00:00
Douglas Gregor adfb842fc1 Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.

llvm-svn: 154668
2012-04-13 16:03:00 +00:00
Douglas Gregor eba02fecdd super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>. 

llvm-svn: 154667
2012-04-13 15:53:08 +00:00
Anton Korobeynikov 4215ca7564 Step forward with supporting of ARM homogenous aggregates:
- Handle unions
  - Handle C++ classes

llvm-svn: 154664
2012-04-13 11:22:00 +00:00
Richard Smith d65cee9423 Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.

llvm-svn: 154659
2012-04-13 06:31:38 +00:00
Richard Smith 822698412b PR12500: Improve the wording of the diagnostic for a redefinition of a name
in the wrong namespace scope. Patch by Jonathan Sauer!

llvm-svn: 154656
2012-04-13 04:07:40 +00:00
Seth Cantrell e83c731cad Support -Wc++98-compat-pedantic as requested:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html

llvm-svn: 154655
2012-04-13 03:43:23 +00:00
John McCall 32233a7c1a Fix a trivial oversight with apple-kext static local destructors
and add a test case.

llvm-svn: 154653
2012-04-13 02:53:27 +00:00
John McCall d239387098 When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

llvm-svn: 154646
2012-04-13 01:08:17 +00:00
Seth Cantrell 10ac7205ce C++11 no longer requires files to end with a newline
llvm-svn: 154643
2012-04-13 01:00:34 +00:00
Richard Smith 01ba47d7b6 Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.

llvm-svn: 154640
2012-04-13 00:45:38 +00:00
Fariborz Jahanian 27db0b3754 objective-c modern translator: beautify rewrite of
struct __rw_objc_super; no functionality change.

llvm-svn: 154632
2012-04-12 23:52:52 +00:00
David Blaikie 9455da0ea9 Warn on 64-to-32 for source value of x bits where 64 >= x > 32.
The codepath already only works for source bits > target bits, it's just that
it was testing for the source expr bits to be exactly 64. This meant simple
cases (int i = x_long / 2) were missed & ended up under the general
-Wconversion warning, which a user might not have enabled.

llvm-svn: 154626
2012-04-12 22:40:54 +00:00
Anna Zaks 8e0785286a [analyzer] PCH deserialization optimization.
We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch, 
 the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

llvm-svn: 154625
2012-04-12 22:36:48 +00:00
Fariborz Jahanian e2b037d6ea objective-c literals: Issue warning and ignore
when BOOL is not of an intergal type when
boolean literals are used. // rdar://11231426

llvm-svn: 154619
2012-04-12 21:24:56 +00:00
Douglas Gregor f9e36cccb5 s/isAtomicConversion/tryAtomicConversion/g, per Jordy's suggestion.
llvm-svn: 154613
2012-04-12 20:48:09 +00:00
Douglas Gregor 298f43df14 Fix some i1/i8 confusion within _Atomic(bool) in IR generation, both
in general (such an atomic has boolean representation) and
specifically for IR generation of __c11_atomic_init. The latter also
means actually using initialization semantics for this initialization,
rather than just creating a store.

On a related note, make sure we actually put in non-atomic-to-atomic
conversions when performing an implicit conversion sequence. IR
generation is far too kind here, but we still want the ASTs to make
sense.

llvm-svn: 154612
2012-04-12 20:42:30 +00:00
Ted Kremenek da76a94bcb Include lambda capture init expressions in CFG.
llvm-svn: 154611
2012-04-12 20:34:52 +00:00
Ted Kremenek e2499844a2 Fix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing function.
llvm-svn: 154607
2012-04-12 20:03:44 +00:00
Simon Atanasyan ce74e9d896 MIPS: Initialize MIPS CPU's name by default value.
Otherwise MipsTargetInfoBase::getDefaultFeatures() might return an invalid
features set with an empty feature name.

llvm-svn: 154606
2012-04-12 19:59:24 +00:00
Douglas Gregor c79862f017 Compute standard conversion sequences for conversions to atomic
types. The second and third conversions in the sequence are based on
the conversion for the underlying type, so that we get sensible
overloading behavior for, e.g., _Atomic(int) vs. _Atomic(float).

As part of this, actually implement the lvalue-to-rvalue conversion
for atomic types. There is probably a pile of code in SemaExpr that
can now be deleted, but I haven't tracked it down yet.

llvm-svn: 154596
2012-04-12 17:51:55 +00:00
Fariborz Jahanian 30c3de97a9 objective-c numeric literal: type of boolean is
that of typedef BOOL if found.
// rdar://11231426

llvm-svn: 154595
2012-04-12 17:49:18 +00:00
Fariborz Jahanian e1240fe743 modern objective-c translator. ifdef'out
__weak and __block when rewriting.
// rdar://11236342

llvm-svn: 154592
2012-04-12 16:33:31 +00:00
Chad Rosier 2c5154224b Fix the signatures for the _mm256_storeu2_* intrinsics.
PR12532

llvm-svn: 154591
2012-04-12 16:29:08 +00:00
Erik Verbruggen 2fca3c2c87 Changed all direct calls to CompletionConsumer.reset(..) to go call
CompilerInstance::setCodeCompletionConsumer instead, in order to change
the SkipFunctionBodies flag accordingly. Also fixed
setCodeCompletionConsumer to take a reset() to null into account.

llvm-svn: 154585
2012-04-12 10:31:12 +00:00
Erik Verbruggen 6e92251f9b Added a flag to the parser to skip method bodies.
llvm-svn: 154584
2012-04-12 10:11:59 +00:00
Richard Smith feea883de4 Implement support for 18 of the GNU-compatible __atomic builtins.
This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.

We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.

llvm-svn: 154579
2012-04-12 05:08:17 +00:00
Eric Christopher 0b1aef2bb0 These functions too have no prototypes. Audited the rest of Sema for
FunctionDecl::Create calls as well.

rdar://11079003

llvm-svn: 154578
2012-04-12 02:16:49 +00:00
Eric Christopher db1554c035 static functions have a need for mangled name debug information too.
The mangler doesn't like non-prototyped functions so only use a mangled
name for prototyped functions.

rdar://11079003

llvm-svn: 154570
2012-04-12 00:35:06 +00:00
Eric Christopher 56ef374611 The copy and destroy helper functions aren't prototyped, don't call them
so.

llvm-svn: 154569
2012-04-12 00:35:04 +00:00
Fariborz Jahanian 5811fd6cc4 modern objective-c translator. Fixes a mis-translation when
of a __block struct object. // rdar://11230308

llvm-svn: 154566
2012-04-11 23:57:12 +00:00
Anna Zaks f36a6f54ae [analyzer] dynamic_cast Simplify null value generation.
As per Jordy's review. Creating a symbol here is more flexible; however
I could not come up with an example where it was needed. (What
constrains can be added on of the symbol constrained to 0?)

llvm-svn: 154542
2012-04-11 22:20:07 +00:00
Fariborz Jahanian aaf4d69ac1 modern objective-c translator. Fixes a translation bug when
first ivar in the list is a bitfield.
// rdar://11229770

llvm-svn: 154534
2012-04-11 21:12:36 +00:00
Richard Smith b8caac8e32 Part of PR10101: after a parse error in a declaration, try harder to find the
right place to pick up parsing. In C++, this had a tendency to skip everything
declared within headers if the TU starts with garbage.

llvm-svn: 154530
2012-04-11 20:59:20 +00:00
Richard Smith b1e36c662b Provide, and document, a set of __c11_atomic_* intrinsics to implement C11's
<stdatomic.h> header.

In passing, fix LanguageExtensions to note that C11 and C++11 are no longer
"upcoming standards" but are now actually standardized.

llvm-svn: 154513
2012-04-11 17:55:32 +00:00
David Chisnall eb9496efc7 Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar types.
llvm-svn: 154507
2012-04-11 17:24:05 +00:00
David Chisnall f6e07b9951 Clean up last commit as per dgregor's comments.
llvm-svn: 154501
2012-04-11 16:08:14 +00:00
David Chisnall 28397be059 Allow c++ initialisers to initialise _Atomic fields.
llvm-svn: 154499
2012-04-11 15:29:15 +00:00
Eric Christopher 3d19de9910 Enable debug info for objective c implementations that may not have
an explicit instance variable.

rdar://10590352

llvm-svn: 154481
2012-04-11 05:56:05 +00:00
Richard Smith 2620cd9903 Support C++11 attributes at the start of a parameter-declaration.
llvm-svn: 154476
2012-04-11 04:01:28 +00:00
Argyrios Kyrtzidis ac1cc934b3 [libclang] If displayDiagnostics is set (when calling clang_createIndex), make sure to
output the errors that occurred even if we did not get an AST (e.g. because the
PCH failed to load).

Also honor displayDiagnostics in clang_indexSourceFile().

rdar://11203489

llvm-svn: 154472
2012-04-11 02:11:16 +00:00
Anna Zaks b508d29b78 [analyzer] Don't crash even when the system functions are redefined.
(Applied changes to CStringAPI, Malloc, and Taint.)

This might almost never happen, but we should not crash even if it does.
This fixes a crash on the internal analyzer buildbot, where postgresql's
configure was redefining memmove (radar://11219852).

llvm-svn: 154451
2012-04-10 23:41:11 +00:00
Richard Smith aa22a8cdcf AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix saving
of an uninitialized Stmt* in serialization of __atomic_init and add a test of
atomics serialization.

llvm-svn: 154448
2012-04-10 22:49:28 +00:00
Fariborz Jahanian 31176b1485 modern objective-c translation: writing container
subscripting. // rdar://11203853

llvm-svn: 154441
2012-04-10 22:06:54 +00:00
Anna Zaks 02ecae9282 [analyzer] dynamic_cast: Better model cast from a reference.
Generate a sink when the dynamic_cast from a reference fails to
represent a thrown exception.

llvm-svn: 154438
2012-04-10 21:29:03 +00:00
Anna Zaks 3bc6809ecb [analyzer] Add support for C++ dynamic_cast.
Simulate the C++ dynamic_cast in the analyzer.

llvm-svn: 154434
2012-04-10 20:59:00 +00:00
Douglas Gregor 85f3423509 When we determine that an initialization sequence failed due to an
incomplete type, keep track of the actual type that was
incomplete. Otherwise, we might fail to produce a diagnostic. Fixes
PR12498.

llvm-svn: 154432
2012-04-10 20:43:46 +00:00
Douglas Gregor 11a434ab2e Improve the printing of __PRETTY_FUNCTION__ more provide more
information and more closely match GCC's, from Nikola Smiljanic!

llvm-svn: 154430
2012-04-10 20:14:15 +00:00
Douglas Gregor 0598962a7b Add a query macro for C++11 N3276, decltype does not require complete
return types, from Michel Morin!

llvm-svn: 154428
2012-04-10 20:00:33 +00:00
Douglas Gregor 350880c4d8 Improve diagnostics in C++11 when a non-type template argument for a
non-type template parameter of pointer type is not a constant expression.

llvm-svn: 154424
2012-04-10 19:03:30 +00:00
Douglas Gregor 2997914ed0 Include the Objective-C parameter- and return-passing qualifiers when
providing code completions for Objective-C method declarations. Fixes
<rdar://problem/11164498>.

llvm-svn: 154421
2012-04-10 18:35:07 +00:00
Eric Christopher 0241e32304 For debug and coverage analysis if we're not optimizing go ahead
and emit a relatively empty block for a plain break statement. This
enables us to track where we went through a switch.

PR9796 & rdar://11215207

llvm-svn: 154420
2012-04-10 18:20:19 +00:00
Douglas Gregor 9489cdf29f Don't include the ':' following code-completion suggestions for
'public', 'private', or 'protected', unless code completion patterns
are enabled. Fixes <rdar://problem/11189132>.

llvm-svn: 154413
2012-04-10 17:56:28 +00:00
Fariborz Jahanian ca5c597fd0 objective-c: remove IsConstProperty as it does not
seem to get called any more. Also add an assert in
isModifiableLvalue.

llvm-svn: 154410
2012-04-10 17:30:10 +00:00
Argyrios Kyrtzidis 9d7c0fef65 [code-complete] Introduce CodeCompletionTUInfo which will be used for caching
code-completion related strings specific to a translation unit (ASTContext and related data)

CodeCompletionAllocator does such limited caching, by caching the name assigned
to a DeclContext*, but that is not the appropriate place since that object has
a lifetime that can extend beyond that of an ASTContext.

Introduce CodeCompletionTUInfo which will be always tied to a translation unit
to do this kind of caching and move the caching of CodeCompletionAllocator into this
object, and propagate it to all the places where it will be needed.

The plan is to extend the caching where appropriate, using CodeCompletionTUInfo,
to avoid re-calculating code-completion strings.

Part of rdar://10796159.

llvm-svn: 154408
2012-04-10 17:23:48 +00:00
Douglas Gregor 20fdef32dd Rework implementation of null non-type template arguments based on
Richard's feedback, to properly catch non-constant expressions and
type mismatches. Finishes <rdar://problem/11193097>.

llvm-svn: 154407
2012-04-10 17:08:25 +00:00
Fariborz Jahanian e84595d618 objective-c: add an assertion for property
expression enterring IsConstProperty function.

llvm-svn: 154406
2012-04-10 16:44:52 +00:00
Chandler Carruth d8f7d38f07 Fix GCC's pedantic return-type warning -- this enum is fully covered.
llvm-svn: 154399
2012-04-10 16:03:08 +00:00
David Chisnall 3d127c79e8 Don't link lib[std]c++ when -nostdlib is specified (Solaris driver).
Patch by Dmitri Shubin!

llvm-svn: 154392
2012-04-10 11:49:50 +00:00
Evgeniy Stepanov 70cb3d623b Pass -march, -mcpu, -mfpu to linuxtools assembler.
llvm-svn: 154389
2012-04-10 09:05:40 +00:00
Duncan Sands e81111ca71 Express the number of ULPs in fpaccuracy metadata as a real rather than a
rational number, eg as 2.5 rather than 5, 2.  OK'd by Peter Collingbourne.

llvm-svn: 154388
2012-04-10 08:23:07 +00:00
Eric Christopher 3910ec96cb EmitStopPoint already checks if we have debug info.
llvm-svn: 154384
2012-04-10 05:04:07 +00:00
Eric Christopher cdbde6973a Tidy.
llvm-svn: 154383
2012-04-10 05:04:04 +00:00
Richard Smith 3dff251da1 Parsing of C++11 attributes:
* Alternative tokens (such as 'compl') are treated as identifiers in
   attribute names.
 * An attribute-list can start with a comma.
 * An ellipsis may not be used with either of our currently-supported
   C++11 attributes.

llvm-svn: 154381
2012-04-10 03:25:07 +00:00
Richard Smith 7bdcc4a9da Disambiguation of '[[':
* In C++11, '[[' is ill-formed unless it starts an attribute-specifier. Reject
   array sizes and array indexes which begin with a lambda-expression. Recover by
   parsing the lambda as a lambda.
 * In Objective-C++11, either '[' could be the start of a message-send.
   Fully disambiguate this case: it turns out that the grammars of message-sends,
   lambdas and attributes do not actually overlap. Accept any occurrence of '[['
   where either '[' starts a message send, but reject a lambda in an array index
   just like in C++11 mode.

Implement a couple of changes to the attribute wording which occurred after our
attributes implementation landed:
 * In a function-declaration, the attributes go after the exception specification,
   not after the right paren.
 * A reference type can have attributes applied.
 * An 'identifier' in an attribute can also be a keyword. Support for alternative
   tokens (iso646 keywords) in attributes to follow.

And some bug fixes:
 * Parse attributes after declarator-ids, even if they are not simple identifiers.
 * Do not accept attributes after a parenthesized declarator.
 * Accept attributes after an array size in a new-type-id.
 * Partially disamiguate 'delete' followed by a lambda. More work is required
   here for the case where the lambda-introducer is '[]'.

llvm-svn: 154369
2012-04-10 01:32:12 +00:00
Fariborz Jahanian 2c00acd67f objective-c modern translator: rewriting specific
implicit casts which is needed to produce good c++
code. // rdar://11202764

llvm-svn: 154360
2012-04-10 00:08:18 +00:00
Rafael Espindola 9446d76e80 Fix an annoying little bug I found while debugging another LTO issue. Gold
requires the -plugin to come before any -plugin-opt options, we were passing
them the other way around. With this one can run (for example):

clang -o foo foo.c -O4 -Wl,-plugin-opt=generate-api-file

llvm-svn: 154357
2012-04-09 23:53:34 +00:00
John McCall dd1eca34b5 My original patch missed the virtual-base case for destroying
base-class subojects.

Incidentally, thinking about virtual bases makes it clear to me that
we're not appropriately computing the access to the virtual base's
member because we're not computing the best possible access to the
virtual base at all;  in fact, we're basically assuming it's public.
I'll file a separate PR about that.

llvm-svn: 154346
2012-04-09 21:51:56 +00:00
John McCall d42742143c Fix the access check performed as part of the determination of whether
to define a special member function as deleted so that it properly
establishes an object context for the accesses to the base subobject
members.

llvm-svn: 154343
2012-04-09 20:53:23 +00:00
Fariborz Jahanian 0568407543 objective-c: remove -fobjc-default-synthesize-properties from the driver.
cc1 option remains though to invoke default property synthesis.
// rdar://11209719

llvm-svn: 154334
2012-04-09 18:58:55 +00:00
Fariborz Jahanian ba8ef296e4 objective-c: Remove -fno-objc-default-synthesize-properties
as the driver option.
// rdar://11209719

llvm-svn: 154331
2012-04-09 18:20:28 +00:00