Commit Graph

24111 Commits

Author SHA1 Message Date
Rafael Espindola 129e43d29b Implement support for reading arguments specified in a file with @file.
llvm-svn: 108672
2010-07-19 03:08:01 +00:00
Zhongxing Xu cf144c6322 fix test case.
llvm-svn: 108671
2010-07-19 02:06:14 +00:00
Zhongxing Xu a74af93eaf remove CallInliner.cpp.
llvm-svn: 108670
2010-07-19 01:55:38 +00:00
Zhongxing Xu ec5623570e Add double close check to StreamChecker. Patch by Lei Zhang.
llvm-svn: 108669
2010-07-19 01:52:29 +00:00
Zhongxing Xu 84f65e0692 Reapply r108617.
llvm-svn: 108668
2010-07-19 01:31:21 +00:00
Daniel Dunbar e38764c66c Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
 - Fixes a problem where the Clang executable path was not initialized properly
   on Win32, because sys::Path::getBasename() doesn't do what I always think it
   does. Imagine that, a sys::Path interface that is confusing!

llvm-svn: 108667
2010-07-19 00:44:04 +00:00
Daniel Dunbar deaff5d792 Update for LLVM API change.
llvm-svn: 108665
2010-07-19 00:33:53 +00:00
Rafael Espindola 7661436220 Refactor the code a bit so that there is only one call to BuildCompilation. The
StringPointers vector will also be used in the normal case to handle @file
arguments.

llvm-svn: 108660
2010-07-18 22:03:55 +00:00
Daniel Dunbar b31b76f1eb Driver: Fix a possible use after free.
llvm-svn: 108659
2010-07-18 21:16:15 +00:00
Chandler Carruth 3973af797a Fix a goof in my previous patch -- not all of the builtins return a value, some
fixed return types.

llvm-svn: 108657
2010-07-18 20:54:12 +00:00
Eli Friedman f8340deacd Fix mangling for static member variables of classes inside an extern "C"
linkage specification.  Not sure if this is the ideal fix, but I'm reasonably
sure it's correct vs. gcc.

llvm-svn: 108656
2010-07-18 20:49:59 +00:00
Chris Lattner e03a5745b1 daniel doesn't hate me, he hates macpython 2.5, which
is a very reasonable position on life!

llvm-svn: 108651
2010-07-18 18:42:35 +00:00
Peter Collingbourne 9e73cae25e When instantiating function definitions set parameter names to those used in template
The rationale is that we are copying the entire definition including
parameter names which may differ between the declaration and the
definition.

This is particularly important if any parameters are unnamed in the
declaration, as a DeclRef to an unnamed ParmVarDecl would cause the
pretty printer to produce invalid output.

llvm-svn: 108643
2010-07-18 16:45:46 +00:00
Douglas Gregor 3efffd05d5 Revert -Wdiscard-qual typo
llvm-svn: 108641
2010-07-18 11:27:38 +00:00
Chandler Carruth bc8cab16c5 Improve the representation of the atomic builtins in a few ways. First, we make
their call expressions synthetically have the "deduced" types based on their
first argument. We only insert conversions in the AST for arguments whose
values require conversion to match the value type expected. This keeps PR7600
closed by maintaining the return type, but avoids assertions due to unexpected
implicit casts making the type unsigned (test case added from Daniel).

The magic is moved into the codegen for the atomic builtin which inserts the
casts as needed at the IR level to raise the type to an integer suitable for
the LLVM intrinsic. This shouldn't cause any real change in functionality, but
now we can make the builtin be more truly polymorphic.

llvm-svn: 108638
2010-07-18 07:23:17 +00:00
Chris Lattner ad4f38b1a9 BUILD_ARCHIVE is the default for libraries, no need to set it.
llvm-svn: 108633
2010-07-18 00:14:47 +00:00
Eli Friedman 3ee1022f37 Fix crash initializing a bit-field with a non-constant in a place where we
try to evaluate the initializer as a constant.

llvm-svn: 108632
2010-07-17 23:55:01 +00:00
Eli Friedman e98194d9e8 Check for casts to an incomplete type in C. Improves diagnostics for cast to
incomplete union (PR5692) and incomplete enum, and fixes obscure
accepts-invalid on cast to incomplete struct.

llvm-svn: 108630
2010-07-17 20:43:49 +00:00
Fariborz Jahanian aea8e1e3d2 Added PCH/ASTImporter code for ObjCIvarDecl's field.
llvm-svn: 108627
2010-07-17 18:35:47 +00:00
Chris Lattner 52c00bdd5b Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste

llvm-svn: 108624
2010-07-17 16:24:30 +00:00
Chris Lattner b2c4937ee4 rename test
llvm-svn: 108623
2010-07-17 16:18:46 +00:00
Chris Lattner 3e40dd34c4 rename test
llvm-svn: 108622
2010-07-17 16:17:41 +00:00
Benjamin Kramer e2e031ed6f Revert r108617, it broke the build.
llvm-svn: 108621
2010-07-17 13:51:58 +00:00
Zhongxing Xu 8de7966fd5 Fix cmake build.
llvm-svn: 108619
2010-07-17 11:59:16 +00:00
Zhongxing Xu 4ca4a999b1 Prepare the analyzer for the callee in another translation unit:
Let AnalysisContext contain a TranslationUnit.
  Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.

llvm-svn: 108617
2010-07-17 11:12:42 +00:00
Daniel Dunbar 05474285aa clang -cc1as: Switch to using AsmParser constructor function.
llvm-svn: 108605
2010-07-17 02:26:21 +00:00
Ted Kremenek b32964d02d Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing a bogus assertion.
llvm-svn: 108602
2010-07-17 01:28:55 +00:00
Fariborz Jahanian 6a06144021 Another test case for on demand synthesis of ivars.
llvm-svn: 108600
2010-07-17 01:16:59 +00:00
Fariborz Jahanian 18722981e2 Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.

llvm-svn: 108599
2010-07-17 00:59:30 +00:00
John McCall 36ea3723c0 The GNU-runtime ObjC personality function doesn't let us rethrow with URR for
multiple reasons.  Rethrow with _objc_exception_throw instead.  Fixes PR7656.

llvm-svn: 108595
2010-07-17 00:43:08 +00:00
Ted Kremenek 8b9fd890e3 Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.

llvm-svn: 108590
2010-07-17 00:40:32 +00:00
Sebastian Redl c2e6dbfa19 Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP
llvm-svn: 108578
2010-07-17 00:12:06 +00:00
Anders Carlsson bb4cfdff7e When checking whether to bind an expression to a temporary, don't bind Obj-C message send expressions who call methods that return references.
llvm-svn: 108559
2010-07-16 21:18:37 +00:00
Craig Silverstein e1c6749665 Fix typeid the same way I fixed sizeof. Sad I had missed it before.
Reviewed by chandlerc

llvm-svn: 108557
2010-07-16 21:15:34 +00:00
Ted Kremenek 0030be81f5 Remove unicode quotes characters that somehow made it into a recent commit of mine.
llvm-svn: 108552
2010-07-16 20:49:01 +00:00
Sebastian Redl 2abc0383ce Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.
llvm-svn: 108551
2010-07-16 20:41:52 +00:00
Tom Care 826e6b4023 Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings

llvm-svn: 108550
2010-07-16 20:41:41 +00:00
Nick Lewycky 725b4e7533 Give the 'self/array-comparison is always true/false' warning a new flag,
"-Wtautological-compare".

llvm-svn: 108546
2010-07-16 18:42:10 +00:00
Ted Kremenek d7b31cc60d Hook up warning for an incomplete scanlist in scanf format strings.
llvm-svn: 108542
2010-07-16 18:28:03 +00:00
Ted Kremenek c618728e8d Tweak zero-field width in scanf format string diagnostic.
llvm-svn: 108541
2010-07-16 18:27:56 +00:00
Sebastian Redl 34522813e7 First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP
llvm-svn: 108537
2010-07-16 17:50:48 +00:00
Chandler Carruth 34833372d1 Make this destructor virtual to placate GCC's warnings.
llvm-svn: 108534
2010-07-16 17:27:32 +00:00
Craig Silverstein 16b7d86ef7 Fix up some of the visiting for array types -- we weren't good about
getting array indices before -- and for some of the builtin operators:
sizeof, offsetof, unaryops like __is_enum.

Also fix the function visitor to visit exception types in function
parameters.

Reviewed by wan and chandlerc.

llvm-svn: 108533
2010-07-16 17:06:12 +00:00
John McCall 934069464e Initialize a couple of fields inherited for our private use.
llvm-svn: 108532
2010-07-16 17:02:45 +00:00
Douglas Gregor fc6c3e73cd When performing template name lookup for a dependent member access
expression such as the "foo" in "this->blah.foo<1, 2>", and we can't
look into the type of "this->blah" (e.g., because it is dependent),
look into the local scope of a template of the same name. Fixes
<rdar://problem/8198511>.

llvm-svn: 108531
2010-07-16 16:54:17 +00:00
Sebastian Redl 1ea025bef9 Add a little more data to chained PCHs. WIP
llvm-svn: 108528
2010-07-16 16:36:56 +00:00
Douglas Gregor 3a8e0d7d57 Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.

llvm-svn: 108527
2010-07-16 15:40:40 +00:00
Douglas Gregor 5692680e0e Suppress the "typedef requires a name" warning in Microsoft-extensions mode
llvm-svn: 108526
2010-07-16 15:18:19 +00:00
John McCall 796c2a52a9 Treat template parameters as part of the declaration-specifiers for the
purpose of access control.  Fixes PR7644.

I can't actually find anything directly justifying this, but it seems obvious.

llvm-svn: 108521
2010-07-16 08:13:16 +00:00
Chandler Carruth eeb3c8419f Make this grossness default to the error it should always be.
llvm-svn: 108511
2010-07-16 05:46:45 +00:00