Commit Graph

806 Commits

Author SHA1 Message Date
Douglas Gregor dc72875d25 Serialize the NoReturn bit on FunctionTypes for precompiled headers
llvm-svn: 91911
2009-12-22 18:11:50 +00:00
Anders Carlsson 3caa2b486d Work around PR5514.
llvm-svn: 91891
2009-12-22 06:13:42 +00:00
Fariborz Jahanian 8120346c57 Template code for rewrite of __block variables - wip.
llvm-svn: 91865
2009-12-22 00:48:54 +00:00
Fariborz Jahanian e175eeb117 Providing support for rewriting of block copy/dispose of
imported block variables. WIP.

llvm-svn: 91856
2009-12-21 23:31:42 +00:00
Daniel Dunbar 91b640abfc Fix a few MSVC warnings.
llvm-svn: 91714
2009-12-18 20:58:47 +00:00
Torok Edwin d0139fd3e5 Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.
llvm-svn: 91698
2009-12-18 17:43:54 +00:00
Torok Edwin 029707885c Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.

llvm-svn: 91694
2009-12-18 17:29:14 +00:00
Daniel Dunbar a7d0231b66 clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
llvm-svn: 91671
2009-12-18 06:30:12 +00:00
Daniel Dunbar 24c7f5efc5 Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
 - Used by parts of Darwin build process to check compiler flags, etc.
 - <rdar://problem/7256886> clang does not emit AT_APPLE_flags

llvm-svn: 91661
2009-12-18 02:43:17 +00:00
Fariborz Jahanian 6ab7ed40c7 Implemented rewriting of invocation of a block ivar.
(radar 7482224).
 

llvm-svn: 91652
2009-12-18 01:15:21 +00:00
Daniel Dunbar 15cef0ed42 Fix -fdollars-in-identifiers Clang translation.
llvm-svn: 91562
2009-12-16 20:10:18 +00:00
Douglas Gregor 4f4b186215 When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.

llvm-svn: 91548
2009-12-16 18:50:27 +00:00
Nuno Lopes 13c88c7269 implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
feel free to chage the name to this lengthy argument

llvm-svn: 91543
2009-12-16 16:59:22 +00:00
Zhongxing Xu 686b8458f4 Expose C++ methods to GRExprEngine.
llvm-svn: 91506
2009-12-16 05:29:59 +00:00
Douglas Gregor 85dabae6ad Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization. 

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.

llvm-svn: 91492
2009-12-16 01:38:02 +00:00
Fariborz Jahanian d1a2d5719a Implement conditional block invocation rewrite
and some clean up and a block rewriter test.

llvm-svn: 91435
2009-12-15 17:30:20 +00:00
Zhongxing Xu 765f3e4f35 Add comments.
llvm-svn: 91430
2009-12-15 09:32:42 +00:00
Zhongxing Xu 950978a44b Remove displayProgress parameter.
llvm-svn: 91429
2009-12-15 09:09:49 +00:00
Daniel Dunbar a5a166d01a Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.

llvm-svn: 91370
2009-12-15 00:06:45 +00:00
Daniel Dunbar 8d4a202aad Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).
llvm-svn: 91238
2009-12-13 03:46:13 +00:00
Daniel Dunbar d613677ec9 CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
llvm-svn: 91237
2009-12-13 03:45:58 +00:00
Daniel Dunbar efa39f7db1 Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.
llvm-svn: 91229
2009-12-12 23:01:36 +00:00
Jeffrey Yasskin 1615d45daa Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.

llvm-svn: 91207
2009-12-12 05:05:38 +00:00
Eli Friedman 3950e8c411 Fix for PR4642: move work in HTMLPrinter out of the destructor.
llvm-svn: 91205
2009-12-12 03:36:52 +00:00
Mike Stump d954638f02 Implement runtime checks for undefined behavior. WIP.
This implements a new flag -fcatch-undefined-behavior.  The flag turns
on additional runtime checks for:

  T a[I];

  a[i]    abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.

llvm-svn: 91198
2009-12-12 01:27:46 +00:00
Ted Kremenek 752ecd8818 We should only scan for nested blocks if we are analyzing the body of a function/method.
llvm-svn: 91196
2009-12-12 01:04:14 +00:00
Daniel Dunbar 520d1e6c6b Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.
llvm-svn: 91176
2009-12-11 23:04:35 +00:00
Nuno Lopes 221c1fd63e spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
llvm-svn: 91002
2009-12-10 00:07:02 +00:00
John McCall 5677499fbf First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to.  This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616

llvm-svn: 90965
2009-12-09 09:09:27 +00:00
Ted Kremenek 06ba78d07d Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.
llvm-svn: 90944
2009-12-09 03:45:19 +00:00
Chris Lattner 53d80e2c07 Neil points out that this could be simplified, do it.
llvm-svn: 90927
2009-12-09 02:08:14 +00:00
Daniel Dunbar e07f152e6d Increase inlining threshold at -O3, to match llvm-gcc.
llvm-svn: 90897
2009-12-08 23:15:55 +00:00
Benjamin Kramer c6ad84cb3c Twinify InitHeaderSearch::AddPath and use it in C++ include path generation.
llvm-svn: 90853
2009-12-08 12:38:20 +00:00
Benjamin Kramer 141c7f987a Use StringRefs in InitHeaderSearch::AddDelimitedPaths.
llvm-svn: 90852
2009-12-08 12:11:06 +00:00
John McCall ce54657e95 DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs.

llvm-svn: 90848
2009-12-08 09:08:17 +00:00
Eli Friedman 897bc03305 Small compatibility fix for -print-decl-contexts.
llvm-svn: 90838
2009-12-08 06:22:37 +00:00
Jeffrey Yasskin 567ae47b4a Remove several .c_str() to be forward-compatible with StringRef.
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Ted Kremenek 6818991d71 Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.
llvm-svn: 90810
2009-12-07 22:06:12 +00:00
Nuno Lopes c4413fbb88 add fedora 12 include path
llvm-svn: 90772
2009-12-07 17:18:48 +00:00
John McCall bcd035061d DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;

llvm-svn: 90743
2009-12-07 02:54:59 +00:00
Chris Lattner 9dfed9fdb6 fix -dM with variadic macros, PR5699
llvm-svn: 90735
2009-12-07 01:58:34 +00:00
Chris Lattner 76b4445d6f some code cleanup.
llvm-svn: 90732
2009-12-07 01:42:56 +00:00
Steve Naroff 30484700c5 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=81871
http://llvm.org/viewvc/llvm-project?view=rev&revision=81936
http://llvm.org/viewvc/llvm-project?view=rev&revision=81945

llvm-svn: 90718
2009-12-06 21:14:13 +00:00
Daniel Dunbar a6cb9f21be Fix an off by one in findEndOfWord, which could scan past the end of the string in a corner case.
llvm-svn: 90703
2009-12-06 09:56:18 +00:00
Steve Naroff 287a2bfc03 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=86026

Note: The 'improved debugging' changes weren't integrated (since they were later reverted, since they didn't improve debugging).
llvm-svn: 90693
2009-12-06 01:52:22 +00:00
Steve Naroff 94ed6dc906 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=82174

llvm-svn: 90692
2009-12-06 01:48:44 +00:00
Steve Naroff 2b3843df1b Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=72893

llvm-svn: 90690
2009-12-06 01:33:56 +00:00
Steve Naroff 66aaa39568 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71473

llvm-svn: 90688
2009-12-06 01:02:14 +00:00
Benjamin Kramer acc5fa153d Don't call back() on an empty vector.
llvm-svn: 90678
2009-12-05 22:16:51 +00:00
Steve Naroff ec60b43ee2 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414

llvm-svn: 90677
2009-12-05 21:43:12 +00:00