Commit Graph

40784 Commits

Author SHA1 Message Date
Alexander Kornienko 2d4f311642 Added a test for C++11 statement attributes serialization.
Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 165068
2012-10-02 23:11:53 +00:00
Fariborz Jahanian e61fc44c3d [Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.

llvm-svn: 165066
2012-10-02 23:01:04 +00:00
Ted Kremenek f1245ddc78 Silence -Wunused-value warning.
llvm-svn: 165059
2012-10-02 21:50:18 +00:00
Chad Rosier 09d7710e04 [ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
A Sema lookup is used to determine the size of the variable, which is in turn
used during wildcard matching.

llvm-svn: 165058
2012-10-02 21:49:14 +00:00
Argyrios Kyrtzidis 4db774a8ef [PCH/Module] Change the map of file-level DeclIDs to use a FileID
as key instead of a SLocEntry pointer. This allows the array of
file sorted declarations in a PCH/module to be deterministic.

llvm-svn: 165047
2012-10-02 21:09:17 +00:00
Argyrios Kyrtzidis 10e7846abf [libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

llvm-svn: 165046
2012-10-02 21:09:13 +00:00
Chad Rosier 7768299b98 [ms-inline asm] Fixup test case to be valid ms-style asm. Fix whitespace.
llvm-svn: 165045
2012-10-02 20:55:30 +00:00
Ted Kremenek 4924a0161b Refactor clients of AnalyzerOptions::getBooleanOption() to have
an intermediate helper method to query and populate the Optional value.

llvm-svn: 165043
2012-10-02 20:42:16 +00:00
Ted Kremenek 3c6932922e Tweak AnalyzerOptions::getOptionAsInteger() to populate the string
table, making it printable with the ConfigDump checker.  Along the
way, fix a really serious bug where the value was getting parsed
from the string in code that was in an assert() call.  This means
in a Release-Asserts build this code wouldn't work as expected.

llvm-svn: 165041
2012-10-02 20:31:56 +00:00
Ted Kremenek 5faa5e04a3 Change AnalyzerOptions::mayInlineCXXMemberFunction to default populate
the config string table.  Also setup a test for dumping the analyzer
configuration for C++.

llvm-svn: 165040
2012-10-02 20:31:52 +00:00
Fariborz Jahanian de0ae1e406 [Doc parsing]: Add available and deprecated attribute info
to XML output. // rdar://12378879

llvm-svn: 165039
2012-10-02 20:05:47 +00:00
Chad Rosier 04d5664295 [ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer size
directives (e.g., dword ptr [eax]).

llvm-svn: 165031
2012-10-02 18:51:05 +00:00
Bill Wendling 5e5cf1a50c Fix test for r165028. It only generates that flag for source files now.
<rdar://problem/12401423>

llvm-svn: 165029
2012-10-02 18:07:59 +00:00
Bill Wendling 3b2000fcac During LTO, we call 'dsymutil' when we compile source files. This necessitates
clang specifying a temporary file that it later cleans up so that it can survive
the linking stage. However, when we compile object files during LTO we don't
call 'dsymutil'. That's done at a different stage (if at all). We rely upon the
linker to specify a unique name for the temporary file it generates.
<rdar://problem/12401423>

llvm-svn: 165028
2012-10-02 18:02:50 +00:00
Rafael Espindola ea0c5ecb28 Convert to FileCheck.
llvm-svn: 165026
2012-10-02 17:41:03 +00:00
Chad Rosier 0ede0986b9 No need to call the InitializeAll* functions.
llvm-svn: 165025
2012-10-02 16:41:12 +00:00
NAKAMURA Takumi 18fc445af5 FP_CONTRACT: Fix two tests for -Asserts.
llvm-svn: 165024
2012-10-02 16:36:54 +00:00
Argyrios Kyrtzidis d4fcf58070 [libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.

llvm-svn: 165023
2012-10-02 16:10:51 +00:00
Argyrios Kyrtzidis f590e094ad Add info in the preprocessing record whether an inclusion directive
resulted in an automatic module import.

llvm-svn: 165022
2012-10-02 16:10:46 +00:00
Argyrios Kyrtzidis b36ee5c592 [libclang] Even though we disable the preprocessing record during indexing,
make sure that it gets enabled for when a module needs to be created.

llvm-svn: 165021
2012-10-02 16:10:41 +00:00
Argyrios Kyrtzidis 472eda06b0 [libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

llvm-svn: 165020
2012-10-02 16:10:38 +00:00
Aaron Ballman a99c35702d Splitting this test case into two because the behavior for the calling convention code is target-specific.
llvm-svn: 165016
2012-10-02 14:56:00 +00:00
Aaron Ballman e91c6be01e Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.
Fixes PR13782

llvm-svn: 165015
2012-10-02 14:26:08 +00:00
Aaron Ballman ac11a9b572 Silencing an MSVC warning about */ being found outside of a comment.
llvm-svn: 165007
2012-10-02 13:54:25 +00:00
Axel Naumann 0439f03bcf Add redecls into their lexical DeclContext: this is what they assert on, and the merging should have set it correctly.
This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different.

llvm-svn: 165005
2012-10-02 13:06:13 +00:00
Axel Naumann 2bd39fd2de Enable programmatic provisioning of virtual module.map files (instead of writing out actual module.map files).
Opens up the wonders of clang::Modules to tools - though they remain as experimental as before.

llvm-svn: 165002
2012-10-02 12:26:36 +00:00
Axel Naumann d9a25b3c17 Only those InterestingDecls that got added to the AST should be passed to the ASTConsumer.
llvm-svn: 165001
2012-10-02 12:18:46 +00:00
Benjamin Kramer e42d406105 -arch is a darwin-specific driver feature, use a triple instead in rewriter test.
llvm-svn: 164995
2012-10-02 09:42:36 +00:00
Benjamin Kramer 4bb04704f3 Force triple in test to unbreak it on non-darwin platforms.
llvm-svn: 164994
2012-10-02 09:29:48 +00:00
Axel Naumann 63469422c4 Merge pending instantiations instead of overwriting existing ones.
Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists).
Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations).

Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing.
templates.mm: test that CodeGen has seen exactly one definition of template instantiations.
redecl-merge.m: use "@" specifier for expected-diagnostics.

llvm-svn: 164993
2012-10-02 09:09:43 +00:00
Bill Wendling 7e5ef83cdb Use an environment variable instead of what's in the make cmd goals.
llvm-svn: 164992
2012-10-02 06:19:15 +00:00
Ted Kremenek 2f88c40ded Tweak diagnostic text to indicate that __weak on a local variable is only allowed
for ARC.  Fixes <rdar://problem/12407705>

llvm-svn: 164990
2012-10-02 05:36:02 +00:00
Lang Hames 5de91cc35f Add FP_CONTRACT support for clang.
Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).

llvm-svn: 164989
2012-10-02 04:45:10 +00:00
Ted Kremenek b67c6cc24d Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.
Fixes <rdar://problem/12355298>

llvm-svn: 164988
2012-10-02 04:36:54 +00:00
Chandler Carruth 01f63b950c Re-enable this test to reflect re-enabling the new SROA pass.
llvm-svn: 164987
2012-10-02 04:24:16 +00:00
Jordan Rose 3c14b2339d -Wformat: Don't check format strings in uninstantiated templates.
Also applies to -Wnonnull, -Wtype-safety, and -Wnon-pod-varargs.
All of these can be better checked at instantiation time.

This change does not actually affect regular CallExpr function calls,
since the checks there only happen after overload resolution.
However, it will affect Objective-C method calls.

<rdar://problem/12373934>

llvm-svn: 164984
2012-10-02 01:49:54 +00:00
NAKAMURA Takumi 5d62a7c5bb clang/test/Index: Fix two tests. Both %S and %t are expanded to absolute paths.
llvm-svn: 164982
2012-10-02 00:11:53 +00:00
Chad Rosier bb90c414c4 [ms-inline asm] Use the convertToMapAndConstraints() function in the front-end.
Rework the logic to account for the fact that we no longer create a MCInst.

llvm-svn: 164980
2012-10-01 23:45:59 +00:00
Michael Gottesman 101290bcef [clang-tests] Changed relative paths to absolute paths in run command for annotate-macro-args.m, get-cursor-macro-args.m, import_self.c.
This fixes make check-all failures when make -C is used to run the tests.

llvm-svn: 164978
2012-10-01 23:39:44 +00:00
Fariborz Jahanian e2a9d42297 Modern translator test. Breakup test into two and
skip the x86_64 version for mingw32 and win32.

llvm-svn: 164977
2012-10-01 23:25:52 +00:00
Fariborz Jahanian 40b169ec68 Rename a test I just added.
llvm-svn: 164971
2012-10-01 21:21:50 +00:00
Fariborz Jahanian 572cc970fb objective-C modern translator. Test for producing both
32bit and 64bit version of modern translator.
// rdar://12189793

llvm-svn: 164970
2012-10-01 20:55:56 +00:00
Richard Smith cdd1da209d Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.
llvm-svn: 164968
2012-10-01 20:36:17 +00:00
Richard Smith 1620ebd98f PR13978: A 'decltype' DeclSpec has an expression representation, not a type
representation. Fix crash if it appears in the return type of a member function
definition.

llvm-svn: 164967
2012-10-01 20:35:07 +00:00
Anna Zaks 97c7ce3368 Move isObjCSelf into Expr.
llvm-svn: 164966
2012-10-01 20:34:04 +00:00
Anna Zaks bfacf17b8b [analyzer] Address Jordan's review for r164868.
llvm-svn: 164965
2012-10-01 20:33:58 +00:00
Fariborz Jahanian a3102b9cde Add xml test for availability to comment-xml-schema.c
llvm-svn: 164961
2012-10-01 19:10:40 +00:00
Jordan Rose 92375adafb [analyzer] Allow ObjC ivar lvalues where the base is nil.
By analogy with C structs, this seems to be legal, if probably discouraged.
It's only if the ivar is read from or written to that there's a problem.
Running a program that gets the "address" of an instance variable does in
fact return the offset when the base "object" is nil.

This isn't a full revert because r164442 includes some diagnostic tweaks
as well; those have been kept.

This partially reverts r164442 / 08965091770c9b276c238bac2f716eaa4da2dca4.

llvm-svn: 164960
2012-10-01 19:07:22 +00:00
Jordan Rose 28c06b268e [analyzer] Add a test for PR13927 "offsetof replacement flagged as null deref"
This seems to be legal according to C11 6.5.3.2.

No functionality change.

llvm-svn: 164959
2012-10-01 19:07:19 +00:00
Jordan Rose 12024f8776 Revert "[analyzer] Check that a member expr is valid even when the result is an lvalue."
The original intent of this commit was to catch potential null dereferences
early, but it breaks the common "home-grown offsetof" idiom (PR13927):

 (((struct Foo *)0)->member - ((struct foo *)0))

As it turns out, this appears to be legal in C, per a footnote in
C11 6.5.3.2: "Thus, &*E is equivalent to E (even if E is a null pointer)".
In C++ this issue is still open:
  http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#232

We'll just have to make sure we have good path notes in the future.

This reverts r164441 / 9be016dcd1ca3986873a7b66bd4bc027309ceb59.

llvm-svn: 164958
2012-10-01 19:07:15 +00:00
Fariborz Jahanian c491c3f27a availability in structured documents. Takes
care of comments by Dimitri and Doug.

llvm-svn: 164957
2012-10-01 18:42:25 +00:00
Ted Kremenek 4a5b35eeec Have AnalyzerOptions::getBooleanOption() stick the matching config
string in the config table so that it can be dumped as part of the 
config dumper.  Add a test to show that these options are sticking
and can be cross-checked using FileCheck.

llvm-svn: 164954
2012-10-01 18:28:19 +00:00
Ted Kremenek 86917fdbe0 Add checker debug.ConfigDumper to dump the contents of the configuration table.
The format of this output is a WIP; largely I'm bringing it up now
for regression testing.  We can evolve the output format over time.

llvm-svn: 164953
2012-10-01 18:28:14 +00:00
Jordan Rose 88dd13fdca Reapply "[analyzer] Handle inlined constructors for rvalue temporaries correctly."
This is related to but not blocked by <rdar://problem/12137950>
("Return-by-value structs do not have associated regions")

This reverts r164875 / 3278d41e17749dbedb204a81ef373499f10251d7.

llvm-svn: 164952
2012-10-01 17:51:35 +00:00
Richard Trieu 3267347cca Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.

llvm-svn: 164951
2012-10-01 17:39:51 +00:00
Jordan Rose d63f04d8a7 [analyzer] Make ProgramStateManager's SubEngine parameter optional.
It is possible and valid to have a state manager and associated objects
without having a SubEngine or checkers.

Patch by Olaf Krzikalla!

llvm-svn: 164947
2012-10-01 16:53:40 +00:00
Daniel Jasper 6f595397bc Fix ASTMatchersTests in configurations where
"#include <initializer_list>" is unavailable for whatever reason.

llvm-svn: 164944
2012-10-01 15:05:34 +00:00
Daniel Jasper 5901e47e8f Add matchers for selected C++11 features.
Patch by Gábor Horváth.
Review: http://llvm-reviews.chandlerc.com/D46

llvm-svn: 164943
2012-10-01 13:40:41 +00:00
Axel Naumann a8243e9aa2 The Redeclarable part of named decls is read before their name.
Lookup can nevertheless find them due to the serialized lookup table.
For instance when reading a template decl's templatedDecl, it will search for existing decls that it could be a redeclaration of, and find the half-read template decl.
Thus there is no point in asserting the names of decls.

llvm-svn: 164932
2012-10-01 09:51:27 +00:00
Axel Naumann 866ba3e365 Also merge template redeclarations.
Don't require specializations (of existing and read template) to be unique.

llvm-svn: 164931
2012-10-01 09:18:00 +00:00
Nico Weber 24d05b0f29 Mark two Clang tests as passing on ARM
Also move one of them from grep to FileCheck.
Patch from Joey Gouly <joey.gouly@arm.com>!

llvm-svn: 164929
2012-10-01 08:44:54 +00:00
Kostya Serebryany f6645c8071 fix test/CodeGen/tbaa-for-vptr.cpp: don't hardcode the index of metadata
llvm-svn: 164928
2012-10-01 08:39:00 +00:00
Axel Naumann a31dee2e04 Bring ASTReader and Writer into sync for the case where a canonical template specialization was written, which is non-canonical at the time of reading: force the reading of the ClassTemplateDecl if it was written.
The easiest way out is to store whether the decl was canonical at the time of writing.
Add test.

llvm-svn: 164927
2012-10-01 07:34:47 +00:00
Benjamin Kramer 1ca66919a5 CodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move assign operator.
This fixes a regression from r162254, the optimizer has problems reasoning
about the smaller memcpy as it's often not safe to widen a store but making it
smaller is.

llvm-svn: 164917
2012-09-30 12:43:37 +00:00
Bill Wendling aae78b861f Filter out tools and unittests which we don't want to build when we're building clang only.
llvm-svn: 164916
2012-09-30 11:23:30 +00:00
Bill Wendling 446fb68894 Remove this hack in favor of another, better way of performing the same thing.
llvm-svn: 164915
2012-09-30 11:22:45 +00:00
Bob Wilson 7a2c7aa3d9 Specify a full target in an attempt to appease buildbots.
llvm-svn: 164908
2012-09-30 00:58:28 +00:00
Bob Wilson 2afa011e0b Add Clang support for iOS6.
llvm-svn: 164907
2012-09-29 23:52:58 +00:00
Bob Wilson 6fc8fb8da5 Add ARM VFPv4 feature and enable it by default for Swift.
llvm-svn: 164906
2012-09-29 23:52:52 +00:00
Bob Wilson d7cf104dae Add armv7s and some other arm variants supported by Mach-O files.
llvm-svn: 164905
2012-09-29 23:52:50 +00:00
Bob Wilson 39d8a132df Add an FMA intrinsic for ARM Neon.
llvm-svn: 164904
2012-09-29 23:52:48 +00:00
Bob Wilson f001a9293d Whitespace.
llvm-svn: 164900
2012-09-29 22:08:54 +00:00
Daniel Jasper 0c30337f6b Fix refersToDeclaration()-matcher and add missing test case. This was
broken as of r164656 as TemplateArgument::getAsDecl() now asserts
instead of returning NULL for other template arugment kinds.

llvm-svn: 164896
2012-09-29 15:55:18 +00:00
Dmitri Gribenko 6743e04699 Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.

llvm-svn: 164892
2012-09-29 11:40:46 +00:00
Dmitri Gribenko 261c9683e2 Comment XML schema: correct indentation.
llvm-svn: 164889
2012-09-29 08:27:37 +00:00
NAKAMURA Takumi 060cfdc8e9 clang/test/CodeGen/tbaa-struct.cpp: Fix. Be aware of 32 bit pointer.
llvm-svn: 164879
2012-09-29 02:00:04 +00:00
Jordan Rose d60b9168fa Revert "[analyzer] Create a temporary region for rvalue structs when accessing fields"
This reverts commit 6f61df3e7256413dcb99afb9673f4206e3c4992c.

llvm-svn: 164877
2012-09-29 01:36:51 +00:00
Jordan Rose d9b0268401 Revert "[analyzer] Create a temp region when a method is called on a struct rvalue."
This reverts commit 0006ba445962621ed82ec84400a6b978205a3fbc.

llvm-svn: 164876
2012-09-29 01:36:47 +00:00
Jordan Rose cd9000e840 Revert "[analyzer] Handle inlined constructors for rvalue temporaries correctly."
This reverts commit 580cd17f256259f39a382e967173f34d68e73859.

llvm-svn: 164875
2012-09-29 01:36:42 +00:00
Argyrios Kyrtzidis 19d78b743f For PPCallbacks::InclusionDirective() add a parameter for the module, whenever
an inclusion directive was automatically turned into a module import, and
PPCallbacks::moduleImport() for an explicit module import.

llvm-svn: 164874
2012-09-29 01:06:10 +00:00
Argyrios Kyrtzidis 43af5132c5 In the Module class, add a reference to the corresponding AST file.
llvm-svn: 164873
2012-09-29 01:06:04 +00:00
Argyrios Kyrtzidis 051b443242 Add an assertion to make sure the implicitly imported module
is the same as the suggested one when looking up the include filename.

llvm-svn: 164872
2012-09-29 01:06:01 +00:00
Anna Zaks 00a896e7a2 [analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.
llvm-svn: 164869
2012-09-29 00:20:40 +00:00
Anna Zaks 0353aad5a9 [analyzer] Re-implement IvarInvalidationChecker so that it verifies that
the validation occurred.

The original implementation was pessimistic - we assumed that ivars
which escape are invalidated. This version is optimistic, it assumes
that the ivars will always be explicitly invalidated: either set to nil
or sent an invalidation message.

llvm-svn: 164868
2012-09-29 00:20:38 +00:00
Richard Smith b555a767ba PR13941: Mark all virtual functions as unnamed_addr. It's not possible to
observe their addresses (taking their address gives the vtable slot) so we are
free to merge their definitions.

llvm-svn: 164864
2012-09-28 22:46:07 +00:00
Jordan Rose 8d17c19796 Use a custom DenseMapInfo for WeakObjectProfileTy.
We can't specialize the usual llvm::DenseMapInfo at the end of the file
because by that point the DenseMap in FunctionScopeInfo has already been
instantiated.

No functionality change.

llvm-svn: 164862
2012-09-28 22:42:04 +00:00
Fariborz Jahanian 35760a8937 [Doc parsing] Add availability information to generated Comment XML.
(I still need to add a test once I figure it out).
Reviewed off-line by Doug. // rdar://12378879

llvm-svn: 164861
2012-09-28 22:35:49 +00:00
Jordan Rose d61f3b4dae Fix buildbots by not using a template from another namespace.
No need to specialize BeforeThanCompare for a comparator that's only
going to be used once.

llvm-svn: 164859
2012-09-28 22:29:02 +00:00
Alexander Kornienko e61e5625e7 Compatibility macro detection for the -Wimplicit-fallthrough diagnostic.
Summary:
When issuing a diagnostic message for the -Wimplicit-fallthrough diagnostics, always try to find the latest macro, defined at the point of fallthrough, which is immediately expanded to "[[clang::fallthrough]]", and use it's name instead of the actual sequence.

Known issues: 
  * uses PP.getSpelling() to compare macro definition with a string (anyone can suggest a convenient way to fill a token array, or maybe lex it in runtime?);
  * this can be generalized and used in other similar cases, any ideas where it should reside then?

Reviewers: doug.gregor, rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 164858
2012-09-28 22:24:03 +00:00
Jordan Rose 13d6b71929 -Wreceiver-is-weak: rephrase warning text and add a suggestion Note.
New output:
  warning: weak property may be unpredictably set to nil
  note: property declared here
  note: assign the value to a strong variable to keep the object alive
        during use

<rdar://problem/12277204>

llvm-svn: 164857
2012-09-28 22:21:42 +00:00
Jordan Rose 62b379873d Pull ScopeInfo implementation into its own file.
The infrastructure for -Warc-repeated-use-of-weak got a little too heavy
to leave sitting at the top of Sema.cpp.

No functionality change.

llvm-svn: 164856
2012-09-28 22:21:39 +00:00
Jordan Rose 657b5f464d -Warc-repeated-use-of-weak: check ivars and variables as well.
Like properties, loading from a weak ivar twice in the same function can
give you inconsistent results if the object is deallocated between the
two loads. It is safer to assign to a strong local variable and use that.

Second half of <rdar://problem/12280249>.

llvm-svn: 164855
2012-09-28 22:21:35 +00:00
Jordan Rose d393458c33 Add a warning (off by default) for repeated use of the same weak property.
The motivating example:

if (self.weakProp)
  use(self.weakProp);

As with any non-atomic test-then-use, it is possible a weak property to be
non-nil at the 'if', but be deallocated by the time it is used. The correct
way to write this example is as follows:

id tmp = self.weakProp;
if (tmp)
  use(tmp);

The warning is controlled by -Warc-repeated-use-of-receiver, and uses the
property name and base to determine if the same property on the same object
is being accessed multiple times. In cases where the base is more
complicated than just a single Decl (e.g. 'foo.bar.weakProp'), it picks a
Decl for some degree of uniquing and reports the problem under a subflag,
-Warc-maybe-repeated-use-of-receiver. This gives a way to tune the
aggressiveness of the warning for a particular project.

The warning is not on by default because it is not flow-sensitive and thus
may have a higher-than-acceptable rate of false positives, though it is
less noisy than -Wreceiver-is-weak. On the other hand, it will not warn
about some cases that may be legitimate issues that -Wreceiver-is-weak
will catch, and it does not attempt to reason about methods returning weak
values.

Even though this is not a real "analysis-based" check I've put the bug
emission code in AnalysisBasedWarnings for two reasons: (1) to run on
every kind of code body (function, method, block, or lambda), and (2) to
suggest that it may be enhanced by flow-sensitive analysis in the future.

The second (smaller) half of this work is to extend it to weak locals
and weak ivars. This should use most of the same infrastructure.

Part of <rdar://problem/12280249>

llvm-svn: 164854
2012-09-28 22:21:30 +00:00
Dan Gohman 22695fcec3 Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls for
struct assignment.

llvm-svn: 164853
2012-09-28 21:58:29 +00:00
Richard Smith 845aa66a8a When processing an InitListExpr and skipping the initialization of an invalid
record, skip at least one element from the InitListExpr to avoid an infinite
loop if we're initializing an array of unknown bound.

llvm-svn: 164851
2012-09-28 21:23:50 +00:00
Richard Trieu b7243855d9 Update template type diffing to handle qualifiers. Differing qualifiers will
now be printed with highlighting.

llvm-svn: 164843
2012-09-28 20:32:51 +00:00
Richard Smith 80ac9efec4 Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by Tijl Coosemans!
llvm-svn: 164841
2012-09-28 20:20:52 +00:00
Richard Trieu 8e14cacfb9 Clean up part of template type diffing. Moved repeated code to separate
functions.  Reworked one of the conditionals.  No functional changes.

llvm-svn: 164839
2012-09-28 19:51:57 +00:00
Fariborz Jahanian 659bc4a792 Modern objcective-C translator. When doing rewriting, Do not
use the integrated pre-processor, preprocess in objective-c++ mode. 
// rdar://12189793.

llvm-svn: 164836
2012-09-28 19:05:17 +00:00
Jordan Rose 19ed6748ea [analyzer] Handle inlined constructors for rvalue temporaries correctly.
Previously the analyzer treated all inlined constructors like lvalues,
setting the value of the CXXConstructExpr to the newly-constructed
region. However, some CXXConstructExprs behave like rvalues -- in
particular, the implicit copy constructor into a pass-by-value argument.
In this case, we want only the /contents/ of a temporary object to be
passed, so that we can use the same "copy each argument into the
parameter region" algorithm that we use for scalar arguments.

This may change when we start modeling destructors of temporaries,
but for now this is the last part of <rdar://problem/12137950>.

llvm-svn: 164830
2012-09-28 17:15:25 +00:00
Jordan Rose b559f18584 [analyzer] Create a temp region when a method is called on a struct rvalue.
An rvalue has no address, but calling a C++ member function requires a
'this' pointer. This commit makes the analyzer create a temporary region
in which to store the struct rvalue and use as a 'this' pointer whenever
a member function is called on an rvalue, which is essentially what
CodeGen does.

More of <rdar://problem/12137950>. The last part is tracking down the
C++ FIXME in array-struct-region.cpp.

llvm-svn: 164829
2012-09-28 17:15:21 +00:00
Jordan Rose e7126582a4 [analyzer] Create a temporary region for rvalue structs when accessing fields
Struct rvalues are represented in the analyzer by CompoundVals,
LazyCompoundVals, or plain ConjuredSymbols -- none of which have associated
regions. If the entire structure is going to persist, this is not a
problem -- either the rvalue will be assigned to an existing region, or
a MaterializeTemporaryExpr will be present to create a temporary region.
However, if we just need a field from the struct, we need to create the
temporary region ourselves.

This is inspired by the way CodeGen handles calls to temporaries;
support for that in the analyzer is coming next.

Part of <rdar://problem/12137950>

llvm-svn: 164828
2012-09-28 17:15:12 +00:00
Benjamin Kramer 5721daae02 Avoid malloc thrashing in the uninitialized value analysis.
- The size of the packed vector is often small, save mallocs using SmallBitVector.
- Copying SmallBitVectors is also cheap, remove a level of indirection.

llvm-svn: 164827
2012-09-28 16:44:29 +00:00
Daniel Jasper d2e6f65b1b Set Diag.ErrorOccurred even if a DiagnosticConsumer does not want it in
diagnostic count.

If a DiagnosticConsumer sub-class overwrites IncludeInDiagnosticCounts,
this should change diagnostic counts. However, it currently also
influences Diag.ErrorOccurred, which in turn influences the behavior of
parsing and semantic analysis (in a way that can make it crash).

llvm-svn: 164824
2012-09-28 15:45:07 +00:00
Eli Friedman c681e5f608 Fix a regression from r164656.
llvm-svn: 164804
2012-09-27 22:13:33 +00:00
Anna Zaks 6aef455573 [analyzer] Address Jordan's code review for r164790.
llvm-svn: 164803
2012-09-27 21:57:17 +00:00
Anna Zaks a0c8331663 [analyzer] IvarInvalidation: track synthesized ivars and allow escape
through property getters.

llvm-svn: 164802
2012-09-27 21:57:14 +00:00
Anna Zaks dd09c34351 Unbreak cmake build
(fixup for r164790)

llvm-svn: 164791
2012-09-27 20:32:46 +00:00
Anna Zaks 461f239331 [analyzer] Add an experimental ObjC direct ivar assignment checker.
llvm-svn: 164790
2012-09-27 19:45:15 +00:00
Anna Zaks 454477cd07 Make getDefaultSynthIvarName() a member of ObjCPropertyDecl.
llvm-svn: 164789
2012-09-27 19:45:11 +00:00
Anna Zaks 8c0dd36ede [analyzer] Address Jordan's code review comments for r164716.
llvm-svn: 164788
2012-09-27 19:45:08 +00:00
Benjamin Kramer 75ee95fa95 Pass PrintingPolicy by reference, copying it isn't cheap.
llvm-svn: 164781
2012-09-27 17:37:30 +00:00
NAKAMURA Takumi 6bbfd1aeca clang/test/CodeGen/ms-inline-asm.c: It requires x86 codegen. Reported by Joey Gouly.
llvm-svn: 164775
2012-09-27 14:55:08 +00:00
Douglas Gregor 07c22b78e5 Following up on r164620, cope with symlinking from an embedded
framework location out to a top-level framework. Such frameworks are
not really embedded at all.

llvm-svn: 164774
2012-09-27 14:50:15 +00:00
Benjamin Kramer 9aabaa39d6 Shrink LinkageInfo from 96 bits to 8 bits.
llvm-svn: 164771
2012-09-27 12:52:55 +00:00
Sylvestre Ledru 33b5baf189 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766
llvm-svn: 164769
2012-09-27 10:16:10 +00:00
Sylvestre Ledru a876013dc9 Fix a typo 'iff' => 'if'
llvm-svn: 164766
2012-09-27 09:57:10 +00:00
NAKAMURA Takumi 453807fffe IvarInvalidationChecker.cpp: Remove an unused member, InterfD. [-Wunused-private-field]
llvm-svn: 164745
2012-09-27 01:52:00 +00:00
Argyrios Kyrtzidis 4fcd2885de Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

llvm-svn: 164743
2012-09-27 01:42:07 +00:00
Jordan Rose 8ba0fba28a Use %clang_cc1 so that the test works even if the target isn't available.
Xcode-style clang builds only support Xcode's architectures, so mips
isn't available and the driver tries to use gcc instead. cc1 will go
ahead and do -fsyntax-only for any platform it knows about even if it
can't actually compile.

llvm-svn: 164742
2012-09-27 01:40:12 +00:00
Argyrios Kyrtzidis 5c8b1cd220 [libclang] Always report a CXCursor_MacroDefinition for code-completion
results for a macro name, not CXCursor_NotImplemented.

llvm-svn: 164740
2012-09-27 00:24:09 +00:00
Bill Wendling 3af41e6c5f Use a variable to stop us from building clang testing tools.
<rdar://problem/11202465>

llvm-svn: 164739
2012-09-27 00:11:09 +00:00
Nick Lewycky 2099bbb24b Turn off this test, as the new and old SROA cause it produce different output.
Left in a note that we need to turn it back on once the SROA fallout is cleared
up.

llvm-svn: 164733
2012-09-26 22:48:46 +00:00
Bill Wendling 6fe7b78db4 Update to new function attribute querying syntax.
llvm-svn: 164726
2012-09-26 21:59:46 +00:00
Benjamin Kramer 2715fce524 Allow -MF to be used in combination with -E -M or -E -MM.
Fixes PR13851. Patch by Dimitry Andric!

llvm-svn: 164717
2012-09-26 19:01:49 +00:00
Anna Zaks 9802f9fb2a [analyzer] Add experimental ObjC invalidation method checker.
This checker is annotation driven. It checks that the annotated
invalidation method accesses all ivars of the enclosing objects that are
objects of type, which in turn contains an invalidation method.

This is driven by
__attribute((annotation("objc_instance_variable_invalidator")).

llvm-svn: 164716
2012-09-26 18:55:16 +00:00
Anna Zaks a3683dd69e [analyzer] Commit a test case for r164579.
llvm-svn: 164715
2012-09-26 18:55:09 +00:00
Ted Kremenek f81b0e387a Have set-xcode-analyer report an error if no xcspec file could be found.
llvm-svn: 164713
2012-09-26 18:19:55 +00:00
Ted Kremenek 66dfa34404 Make set-xcode-analyzer more tolerant of the naming differenes reported by xcode-select.
llvm-svn: 164712
2012-09-26 18:13:03 +00:00
Ted Kremenek 8971b028e7 Revert "Use sep instead of ' '."
This isn't correct, as Jordan correctly points out.

llvm-svn: 164711
2012-09-26 18:06:08 +00:00
DeLesley Hutchins f39c0c2487 Fix template instantiation of attributes. More specifically, fix the case
where an attribute is attached to a forward declaration of a template function,
and refers to parameters of that declaration, but is then inherited by the
definition of that function.  When the definition is instantiated, the
parameter references need to be remapped.

llvm-svn: 164710
2012-09-26 17:57:31 +00:00
Ted Kremenek 2de0a9919b Use sep instead of ' '.
llvm-svn: 164709
2012-09-26 17:23:31 +00:00
Jordan Rose 17df40d484 Make our mini-stdint.h platform-independent by using predefined macros.
This also adds a definition for uint64_t, which was causing build failures
on some platforms. (I'm actually surprised this didn't happen on more
builders, but maybe the search paths are different.)

llvm-svn: 164706
2012-09-26 16:41:11 +00:00
Argyrios Kyrtzidis 9ae3956f22 [libclang] Remove the ParentKind cursor kind from code-completion results.
This is to reduce dependency to cursors for the code-completion results.

llvm-svn: 164705
2012-09-26 16:39:56 +00:00
Argyrios Kyrtzidis 39a76387e0 Have ASTUnit::Save() return a bool to indicate save error.
Removes a dependency of ASTUnit to clang-c/Index.h.

llvm-svn: 164704
2012-09-26 16:39:46 +00:00
Logan Chien 35795cf9c1 Fix build failure and enhance the testcase for unwind.h.
llvm-svn: 164683
2012-09-26 09:40:37 +00:00
Benjamin Kramer 010f114093 Run test in a freestanding environment so it doesn't accidentally pick up system headers for the wrong target.
While there add a test that verifies that the header parses in C++ mode.

llvm-svn: 164679
2012-09-26 09:10:53 +00:00
Nico Weber c05ecd5b17 Fix two more tests that didn't do anything.
Found with
  find test -type f | xargs grep RUN: | grep '%clang' | grep -iv '%s' | grep -v '%t' | grep -v '\\$'

llvm-svn: 164678
2012-09-26 09:09:17 +00:00
Nico Weber f666b2a547 Make this test actually test something
llvm-svn: 164677
2012-09-26 09:02:07 +00:00
Nico Weber dd9602fe93 Revert r163022, it caused PR13924.
Add a test for PR13924. Do not revert the test added in r163022,
it surprisingly still passes even after reverting the code changes.

llvm-svn: 164672
2012-09-26 08:19:01 +00:00
Logan Chien 774442162d Add struct keyword before _Unwind_Context.
In the C programming language, we have to add the
"struct" keyword.  Otherwise, the compiler will
emit error message.

llvm-svn: 164665
2012-09-26 06:35:17 +00:00
Ted Kremenek a808e165b2 Remove unnecessary ASTContext& parameter from SymExpr::getType().
llvm-svn: 164661
2012-09-26 06:00:14 +00:00
Nico Weber ca496f34a2 Add codegen support for the __debugbreak intrinsic.
llvm-svn: 164660
2012-09-26 05:40:16 +00:00
Eli Friedman 15681d6852 Fix an edge case of mangling involving the combination of a lambda and typeid.
typeid (and a couple other non-standard places where we can transform an
unevaluated expression into an evaluated expression) is special
because it introduces an an expression evaluation context,
which conflicts with the mechanism to compute the current
lambda mangling context.  PR12123.

I would appreciate if someone would double-check that we get the mangling
correct with this patch.

llvm-svn: 164658
2012-09-26 04:34:21 +00:00
Eli Friedman b826a00857 Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.

llvm-svn: 164656
2012-09-26 02:36:12 +00:00
Richard Smith 6e0605d654 Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType
for a type alias template can appear as sugar at any level of desugaring, just
like a TypedefType.

llvm-svn: 164655
2012-09-26 02:18:13 +00:00
Ted Kremenek bc8cd06865 Update checker build.
llvm-svn: 164649
2012-09-25 23:58:39 +00:00
Michael J. Spencer 9d1221a281 [Options] Store the option ID in OptTable::Info.
llvm-svn: 164644
2012-09-25 23:12:48 +00:00
Ted Kremenek 15a4bea41e Remove 'const' version of getBasicVals(), which is useless.
llvm-svn: 164643
2012-09-25 23:12:12 +00:00
Jordan Rose de584de370 Rename CanFitInto64Bits to alwaysFitsInto64Bits per discussion on IRC.
This makes the behavior clearer concerning literals with the maximum
number of digits. For a 32-bit example, 4,000,000,000 is a valid uint32_t,
but 5,000,000,000 is not, so we'd have to count 10-digit decimal numbers
as "unsafe" (meaning we have to check for overflow when parsing them,
just as we would for numbers with 11 digits or higher). This is the same,
only with 64 bits to play with.

No functionality change.

llvm-svn: 164639
2012-09-25 22:32:51 +00:00
Chad Rosier c30eb1c282 [driver] Add support for the -fno-fast-math option.
rdar://12299433

llvm-svn: 164638
2012-09-25 22:03:25 +00:00
Argyrios Kyrtzidis 341de09dcd [libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.
llvm-svn: 164626
2012-09-25 19:29:50 +00:00
Argyrios Kyrtzidis 2f45853f2f Improve upon r164450 and localize the logic of updating the type of
a function decl inside the ASTNodeImporter::VisitFunctionDecl function.

llvm-svn: 164625
2012-09-25 19:26:39 +00:00
Dmitri Gribenko 511288b2b5 Optimize NumericLiteralParser::GetIntegerValue().
It does a conservative estimate on the size of numbers that can fit into
uint64_t.  This bound is improved.

llvm-svn: 164624
2012-09-25 19:09:15 +00:00
Jordan Rose 902f02db72 [analyzer] Add tests for symbolic expression liveness.
There are very few tests here because SValBuilder is fairly aggressive
about not building SymExprs that we can't evaluate, which saves memory
and CPU but also makes it very much tied to the current constraint
manager. We should probably scale back here and let things decay to
UnknownVal later on.

bitwise-ops.c tests that for the SymExprs we do create, we persist our
assumptions about them. traversal-path-unification.c tests that we do
clean out constraints on arbitrary SymExprs once they have actually died.

llvm-svn: 164623
2012-09-25 19:03:09 +00:00
Jordan Rose db72e2fc37 Reapply "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Previously, we'd just keep constraints around forever, which means we'd
never be able to merge paths that differed only in constraints on dead
symbols.

Because we now allow constraints on symbolic expressions, not just single
symbols, this requires changing SymExpr::symbol_iterator to include
intermediate symbol nodes in its traversal, not just the SymbolData leaf
nodes.

This depends on the previous commit to be correct. Originally applied in
r163444, reverted in r164275, now being re-applied.

llvm-svn: 164622
2012-09-25 19:03:06 +00:00
Jordan Rose 60d704ab4a [analyzer] Calculate liveness for symbolic exprs as well as atomic symbols.
No tests, but this allows the optimization of removing dead constraints.
We can then add tests that we don't do this prematurely.

<rdar://problem/12333297>

Note: the added FIXME to investigate SymbolRegionValue liveness is
tracked by <rdar://problem/12368183>. This patch does not change the
existing behavior.

llvm-svn: 164621
2012-09-25 19:03:01 +00:00
Douglas Gregor 24ff3bc392 Under certain terrible circumstances (<rdar://problem/10805775>),
top-level frameworks can actually be symlinked over to embedded
frameworks, and accessed via the top-level framework's headers. In
this case, we need to determine that the framework was *actually* an
embedded framework, so we can load the appropriate top-level module.

llvm-svn: 164620
2012-09-25 18:29:14 +00:00
Alexander Kornienko 1d26c02722 Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.
Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules.

Reviewers: doug.gregor

Reviewed By: alexfh

CC: cfe-commits, rsmith

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

llvm-svn: 164610
2012-09-25 17:18:14 +00:00
Bob Wilson 24719e3236 Examine the last, not the first, instruction from the MC matcher.
If an MS-style inline asm is matched to multiple instructions, e.g., with a
a WAIT-prefix, then we need to examine the operands of the last instruction
instruction, not the prefix instruction.

llvm-svn: 164608
2012-09-25 16:30:16 +00:00
Douglas Gregor e6a82d9018 -iframework should allow separate arguments.
llvm-svn: 164607
2012-09-25 16:13:41 +00:00
Douglas Gregor c83de30add Introduce builtin macros to determine whether we're building a
specific module (__building_module(modulename)) and to get the name of
the current module as an identifier (__MODULE__). 

Used to help headers behave differently when they're being included as
part of building a module. Oh, the irony.

llvm-svn: 164605
2012-09-25 15:44:52 +00:00
Alexander Kornienko dcaf4a3a4b A minor doc fix.
llvm-svn: 164601
2012-09-25 12:42:05 +00:00
Hans Wennborg c980408c71 Fix failing test/Sema/wchar.c on ARM.
Currently Sema/wchar.c fails because WCHAR_T_TYPE is defined as int,
however on ARM wchar_t is unsigned int.

This patch changes that, so this test passes for ARM.

Patch by Joey Gouly!

llvm-svn: 164598
2012-09-25 10:11:17 +00:00
John McCall 82fb892019 When performing a ::delete of an object with a virtual destructor,
be sure to delete the complete object pointer, not the original
pointer.  This is necessary if the base being deleted is at a
non-zero offset in the complete object.  This is only required
for objects with virtual destructors because deleting an object
via a base-class subobject when the base does not have a virtual
destructor is undefined behavior.

Noticed while reviewing the last four years of cxx-abi-dev
activity.

llvm-svn: 164597
2012-09-25 10:10:39 +00:00
NAKAMURA Takumi 924ce0d9aa clang/test/CodeGenCXX/microsoft-*: Fix for -Asserts.
llvm-svn: 164594
2012-09-25 09:53:18 +00:00
John McCall f652e9a6b0 Implement Mike Herrick's proposed noexcept mangling.
llvm-svn: 164593
2012-09-25 09:10:17 +00:00
John McCall 0f999f329c In the MS ABI, ctors return 'this'. Patch by Dmitry Sokolov.
llvm-svn: 164592
2012-09-25 08:00:39 +00:00
John McCall bf4a7d7193 Add the Microsoft __is_interface_class type trait.
Patch by Andy Gibbs!

llvm-svn: 164591
2012-09-25 07:32:49 +00:00
John McCall db632ac004 Fix for r163013 regression and further __interface enhancement.
Patch by Andy Gibbs!

llvm-svn: 164590
2012-09-25 07:32:39 +00:00
John McCall b0433eeb2e During jump-scope checking, build an ExprWithCleanups immediately
into the enclosing scope;  this is a more accurate model but is
(I believe) unnecessary in my test case due to other flaws.
However, one of those flaws is now intentional:  blocks which
appear in return statements can be trivially observed to not
extend in lifetime past the return, and so we can allow a jump
past them.  Do the necessary magic in IR-generation to make
this work.

llvm-svn: 164589
2012-09-25 06:56:03 +00:00
Richard Smith 88d67f3412 Fix crash when a decltype expression in a trailing return type refers to the
function being instantiated. An error recovery codepath was recursively
performing name lookup (and triggering an unbounded stack of template
instantiations which blew out the stack before hitting the depth limit).

Patch by Wei Pan!

llvm-svn: 164586
2012-09-25 04:46:05 +00:00
Eli Friedman cda3db801f Delete some code which is, as far as I can tell, dead.
llvm-svn: 164580
2012-09-25 01:02:42 +00:00
Anna Zaks 4396c54c14 [analyzer] Fix a buildbot crash triggered by turning on dynamic
dispatch.

llvm-svn: 164579
2012-09-25 00:31:43 +00:00
Richard Smith 60f2e1efb8 Don't produce diagnostics for missing ctor-initializers during template
instantiations if we encountered errors parsing some of the initializers.

llvm-svn: 164578
2012-09-25 00:23:05 +00:00
Eli Friedman bdd5753bda Handle C++ functional casts in a similar way to C-style casts in
unused expression warnings.  <rdar://problem/12359208>.

llvm-svn: 164569
2012-09-24 23:02:26 +00:00
Chad Rosier 93b3eb7793 Update for r164567.
llvm-svn: 164568
2012-09-24 22:58:50 +00:00
Fariborz Jahanian 61740f6649 objective-C: use 'instance variables' as plural when referring
to the feature.

llvm-svn: 164566
2012-09-24 22:51:51 +00:00
Fariborz Jahanian 14fd801f8f objective-C: remove use of 'ivar' in favor of
'instance variable' in text of all diagnostics
for objective-C: // rdar://12352442

llvm-svn: 164559
2012-09-24 22:00:36 +00:00
Ted Kremenek 3d0ec38cb4 Add clarifying comment.
llvm-svn: 164557
2012-09-24 21:17:14 +00:00
Dmitri Gribenko 2e0e3f37be More tests for r164545 (change extension warning about 'long long').
llvm-svn: 164556
2012-09-24 21:09:05 +00:00
Dmitri Gribenko b8e9e7507e StringRef'ize Preprocessor::CreateString().
llvm-svn: 164555
2012-09-24 21:07:17 +00:00
Dmitri Gribenko ae07f72017 Replace raw call to snprintf() by llvm streams.
llvm-svn: 164554
2012-09-24 20:56:28 +00:00
Bob Wilson 317be45091 Replace an assertion with an error for empty __asm statements.
llvm-svn: 164551
2012-09-24 19:57:59 +00:00
Bob Wilson 0fc64f0b11 Fix a comment typo and clean up formatting.
llvm-svn: 164550
2012-09-24 19:57:55 +00:00
Douglas Gregor e769d862ee Make sure that we don't end up making an #undef'd macro visible after
the fact. Test cases will come when we're actually (de-)serializing
macro history.

llvm-svn: 164549
2012-09-24 19:56:18 +00:00
Argyrios Kyrtzidis 5eae073cb1 [libclang] Bring CXCursor_AsmStmt back as an alias for CXCursor_GCCAsmStmt.
This was renamed in r162632 which was badness because the C API needs to be stable.
rdar://12360096

llvm-svn: 164547
2012-09-24 19:27:20 +00:00
Dmitri Gribenko 61b4b7f0f3 Include 'long long' extension warning in the LongLong group so that it can be
silenced by -Wno-long-long.  Thanks Richard Smith for the fix idea!

llvm-svn: 164546
2012-09-24 19:05:10 +00:00
Dmitri Gribenko 1cd2305703 Change the wording of the extension warning from
> 'long long' is an extension when C99 mode is not enabled
to
> 'long long' is a C++11 extension
while compiling in C++98 mode.

llvm-svn: 164545
2012-09-24 18:19:21 +00:00
Anna Zaks b9828203df [analyzer] Really turn on dynamic-bifurcation on by default.
Thanks to Byoungyoung for realizing taht we are not passing the default
option correctly.

llvm-svn: 164543
2012-09-24 17:43:47 +00:00
Anna Zaks e20b201dda [analyzer] Remove unused.
llvm-svn: 164542
2012-09-24 17:43:44 +00:00
Anna Zaks 3533a54a97 [analyzer]Prevent infinite recursion(assume->checker:evalAssume->assume)
(Unfortunately, I do not have a good reduced test case for this.)

llvm-svn: 164541
2012-09-24 17:43:41 +00:00
Alexander Potapenko 34b46ca48e Use an explicit target to test that source fortification is off when building for Darwin with -faddress-sanitizer.
llvm-svn: 164485
2012-09-24 10:25:24 +00:00
Dmitri Gribenko 7ba91723e7 Small cleanup of literal semantic analysis: hiding 'char *' pointers behind
StringRef makes code cleaner.  Also, make the temporary buffer smaller:
512 characters is unreasonably large for integer literals.

llvm-svn: 164484
2012-09-24 09:53:54 +00:00
Chandler Carruth ed2a284977 Update the Clang tests which run with a full optimization pipeline for
the new SROA pass. This is a benign change: the order of PHI nodes
changed.

llvm-svn: 164481
2012-09-24 01:10:25 +00:00
NAKAMURA Takumi f5a898c305 unittests/AST/StmtPrinterTest.cpp: Suppress a LP64-assumed test, "0x100000000i128 => 4294967296L", for now.
LONG_MAX is 2147483647L on common 32 bit and LLP64 (Windows x64).

llvm-svn: 164478
2012-09-24 00:34:18 +00:00
Dmitri Gribenko 24bef9a4e9 As a followup for r164303, add some tests for printing literals that test
printing directly rather than through a complicated machinery of ObjC rewriter.

llvm-svn: 164477
2012-09-23 20:29:07 +00:00
Rafael Espindola 151a957fb0 Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.
llvm-svn: 164473
2012-09-23 03:05:41 +00:00
Rafael Espindola 66431cd10f On Hexagon getArchName() never returns x86_64, simplify the function.
llvm-svn: 164470
2012-09-22 22:58:57 +00:00
Rafael Espindola ccaa3b6eb2 Use pipes.
llvm-svn: 164469
2012-09-22 22:51:00 +00:00