Commit Graph

71756 Commits

Author SHA1 Message Date
Dan Gohman 84bb28fc84 Prefix MBB numbers with "BB#" in debug output to make it clear what
the numbers mean.

llvm-svn: 86854
2009-11-11 18:23:17 +00:00
Dan Gohman f4141f1dda Minor code simplification.
llvm-svn: 86853
2009-11-11 18:18:34 +00:00
Dan Gohman acc57b2446 Fix a copy+pasto in a comment.
llvm-svn: 86852
2009-11-11 18:14:02 +00:00
Dan Gohman 9fd22f68f2 Set isBarrier = 1 on return instructions, as they are control barriers.
llvm-svn: 86851
2009-11-11 18:11:07 +00:00
Dan Gohman d2a0f80ede Use a tab in INT3's asm string, for consistency.
llvm-svn: 86850
2009-11-11 18:07:16 +00:00
Fariborz Jahanian 03f62ed9bb Value initialize non-class array members in ctor's
initializer list. Fixes PR5463.

llvm-svn: 86849
2009-11-11 17:55:25 +00:00
Chris Lattner 7a09964e81 another const prop failure.
llvm-svn: 86848
2009-11-11 17:54:02 +00:00
Chris Lattner 539bdf0487 add a note
llvm-svn: 86847
2009-11-11 17:51:27 +00:00
Chris Lattner 7eb84155a5 Reject duplicate case values in a switch, PR5450.
llvm-svn: 86846
2009-11-11 17:37:02 +00:00
Ted Kremenek 91989d166a Split buffer overflow test case into two test cases, removing out logic that was commented out.
llvm-svn: 86845
2009-11-11 17:17:06 +00:00
Douglas Gregor 38fee967ae Instantiation of template template parameters for nested templates, e.g.,
template<typename T>
  struct X {
    template<template<T Value> class Y> struct Inner;
  };

llvm-svn: 86844
2009-11-11 16:58:32 +00:00
Douglas Gregor 120635bc9c Fix speculative parsing of dependent template names in
nested-name-specifiers so that they don't gobble the template name (or
operator-function-id) unless there is also a
template-argument-list. For example, given

  T::template apply

we would previously consume both "template" and "apply" as part of
parsing the nested-name-specifier, then error when we see that there
is no "<" starting a template argument list. Now, we parse such
constructs tentatively, and back off if the "<" is not present. This
allows us to parse dependent template names as one would use them for,
e.g., template template parameters:

  template<typename T, template<class> class X = T::template apply>
    struct MetaSomething;

Also, test default arguments for template template parameters.

llvm-svn: 86841
2009-11-11 16:39:34 +00:00
Duncan Sands ba61fed5d3 Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end.  If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game.  There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted.  But since no passes do anything interesting with it yet
this will have to wait for later.

llvm-svn: 86840
2009-11-11 15:34:13 +00:00
Zhongxing Xu b166712d02 Add undefined array subscript checker.
llvm-svn: 86837
2009-11-11 13:42:54 +00:00
Zhongxing Xu 83c4374e72 Remove the old out-of-bound checking code.
llvm-svn: 86836
2009-11-11 12:52:39 +00:00
Zhongxing Xu 4f7759a339 Reimplement out-of-bound array access checker with the new checker interface.
Now only one test case is XFAIL'ed.

llvm-svn: 86834
2009-11-11 12:33:27 +00:00
Zhongxing Xu 3ef93badbe ReturnPointerRangeChecker: use StripCasts() instead of checking for zero index
explicitly.

Fix 80-col violations.

llvm-svn: 86833
2009-11-11 11:55:54 +00:00
Daniel Dunbar f580187aed Simplify.
llvm-svn: 86830
2009-11-11 10:22:48 +00:00
Daniel Dunbar 559f7a5c3c Fix unsafe use of StringRef I introduced.
llvm-svn: 86829
2009-11-11 10:10:25 +00:00
Daniel Dunbar 22bdabf05f Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

llvm-svn: 86828
2009-11-11 10:07:44 +00:00
Daniel Dunbar 531f6c662b Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

llvm-svn: 86827
2009-11-11 10:07:22 +00:00
Daniel Dunbar 979586e755 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

llvm-svn: 86826
2009-11-11 09:38:56 +00:00
Daniel Dunbar eced7e065f Minor formatting tweaks.
llvm-svn: 86825
2009-11-11 09:38:42 +00:00
Daniel Dunbar 759cab9a54 clang-cc: Refactor some -fixit-at handling.
llvm-svn: 86824
2009-11-11 09:38:35 +00:00
Daniel Dunbar d0c3bb0df2 Allow TextDiagnosticPrinter to have optional ownership of its output stream.
llvm-svn: 86823
2009-11-11 09:38:24 +00:00
Daniel Dunbar 23ede2d9d1 Update CMake.
llvm-svn: 86822
2009-11-11 08:14:02 +00:00
Daniel Dunbar d2cfa0111c clang-cc: Move InitializeAnalyzerOptions into Options.cpp
llvm-svn: 86821
2009-11-11 08:13:55 +00:00
Daniel Dunbar ef0147c0e9 clang-cc: Start coalescing "frontend" options.
llvm-svn: 86820
2009-11-11 08:13:47 +00:00
Daniel Dunbar dcd40fb95f clang-cc: Move InitializeDiagnosticOptions to Options.cpp
llvm-svn: 86819
2009-11-11 08:13:40 +00:00
Daniel Dunbar f527a12e47 clang-cc: Move HeaderSearchOptions to Options.cpp
llvm-svn: 86818
2009-11-11 08:13:32 +00:00
Daniel Dunbar b6bac22d02 Turn LoggingDiagnosticClient into a more general ChainedDiagnosticClient and
move to libFrontend.

llvm-svn: 86817
2009-11-11 08:13:24 +00:00
Daniel Dunbar 84dfbfde26 clang-cc: Move InitializeLangOptions to Options.cpp.
Also, inline InitializeLanguageStandard into InitializeLangOptions; this code
needs to be refactored but the current division doesn't make any sense.

llvm-svn: 86816
2009-11-11 07:26:12 +00:00
Daniel Dunbar f0f6f0efb0 Inline some trivial functions.
llvm-svn: 86815
2009-11-11 07:26:02 +00:00
Evan Cheng 7e5e40c75e Add nounwind.
llvm-svn: 86814
2009-11-11 07:11:02 +00:00
Ted Kremenek 04552cbef0 CastToStructChecker: use 'isStructureType()' instead of 'isRecordType()' to determine if a pointer is casted to a struct pointer. This fixes an observed false positive when a value is casted to a union.
llvm-svn: 86813
2009-11-11 06:43:42 +00:00
Ted Kremenek 55d59bf785 Fix display of "ANALYZE" statements in AnalysisConsumer by correctly resetting the flag indicating that the current Decl* has not yet been displayed. Also move this out of AnalysisManager, since AnalysisManager should not handle text output to the user.
llvm-svn: 86812
2009-11-11 06:28:42 +00:00
Daniel Dunbar 999215c8c8 clang-cc: Move InitializePreprocessorOptions to Options.cpp
llvm-svn: 86811
2009-11-11 06:10:03 +00:00
Chris Lattner 852f2653c4 remove the now dead condprop pass, PR3906.
llvm-svn: 86810
2009-11-11 05:56:35 +00:00
Ted Kremenek 4325315935 Remove public headers for UndefinedArgChecker, AttrNonNullChecker, and BadCallChecker, making their implementations completely private.
llvm-svn: 86809
2009-11-11 05:50:44 +00:00
Daniel Dunbar de142beafb clang-cc: Simplify this code, now that predefines handling is uniform in the
PCH/-E and PCH/not--E cases.

llvm-svn: 86808
2009-11-11 05:33:31 +00:00
Jeffrey Yasskin e822c99eaa Fix JITTest.ModuleDeletion in -Asserts mode (which turns off JITEmitDebugInfo
by default).

llvm-svn: 86807
2009-11-11 05:30:02 +00:00
Daniel Dunbar 000c4ffd16 Redo how PCH handles its implicit include. Instead of treating this specially in
the front-end (as far as the preprocessor goes), follow the usual logic of
inserting the (original include path) name into the predefines buffer. This
pushes the responsibility for handling this to PCH instead of the front-end.  In
PCH this requires being a little more clever when we diff the predefines
buffers.

Neither of these solutions are particularly great, I think what we eventually
should do is something like gcc where we insert a special marker to indicate the
PCH file, but then run the preprocessor as usual. This would be clearer and
would allow us to drop the overly clever predefines handling.

llvm-svn: 86806
2009-11-11 05:29:04 +00:00
Daniel Dunbar 499baed8a8 More StringRef simplification to PCHValidator::ReadPredefinesBuffer.
llvm-svn: 86805
2009-11-11 05:26:28 +00:00
Chris Lattner 3e308fb0ee remove condprop testcases.
llvm-svn: 86804
2009-11-11 05:25:16 +00:00
Daniel Dunbar 74bb710227 Add StringRef::split(StringRef), to complement StringRef::split(char).
llvm-svn: 86803
2009-11-11 05:19:11 +00:00
Rafael Espindola cd6291506b Remove dead code.
llvm-svn: 86802
2009-11-11 04:10:24 +00:00
Daniel Dunbar 775f18520c And now a test fix in +Asserts mode, which I broke.
llvm-svn: 86801
2009-11-11 03:48:34 +00:00
Daniel Dunbar 568e302a7f Fix some tests in -Asserts mode.
- FileCheck is a *huuuuge* improvement here.

 - Still feels like we could use a better tool for this though, either teach
   llvm-dis to spit out the FileCheck syntax, or provide another tool to turn a
   .ll into a "matchable" input.

 - Also on my Christmas list is better FileCheck diagnostics with missing
   variables or mismatches.

llvm-svn: 86800
2009-11-11 03:48:26 +00:00
Daniel Dunbar 8665c7e39d Rewrite splitLines using StringRef; this is much simpler, and also now avoids
tons of std::string trashing. I plan to move this and other fun string munging
utilities to a StringRefExtras.h at some point if no one beats me to it.

On a synthetic benchmark on x86_64, llvm-gcc actually generates code thats 10%
faster using the StringRef version. gcc miscompiles the synthetic benchmark,
which I'm crossing my fingers and hoping won't happen here. clang compiles the
sythetic benchmark correctly (wootness), but the StringRef version is
slower. Silly clang.

llvm-svn: 86799
2009-11-11 03:45:59 +00:00
Ted Kremenek 5e1f78aeb1 Refactor DereferenceChecker to use only the new Checker API instead of
the old builder API.  This percolated a bunch of changes up to the
Checker class (where CheckLocation has been renamed VisitLocation) and
GRExprEngine.  ProgramPoint now has the notion of a "LocationCheck"
point (with PreLoad and PreStore respectively), and a bunch of the old
ProgramPoints that are no longer used have been removed.

llvm-svn: 86798
2009-11-11 03:26:34 +00:00