Commit Graph

57228 Commits

Author SHA1 Message Date
Ted Kremenek 01cccbfb03 Update checker build.
llvm-svn: 68302
2009-04-02 06:33:06 +00:00
Chris Lattner 098d94a57d add TemplateName.cpp/h to the xcode project, minor tidying.
llvm-svn: 68301
2009-04-02 06:07:12 +00:00
Anders Carlsson cbaeb9e633 Emit code for linkage specifications.
llvm-svn: 68300
2009-04-02 05:55:18 +00:00
Ted Kremenek a64bbc68fc Also "flatten" PathLocations fed to the HTMLDiagnosticClient. We need a better
long-term strategy, but this should work for now.

llvm-svn: 68297
2009-04-02 05:17:38 +00:00
Ted Kremenek 12f510aa8f Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.

llvm-svn: 68292
2009-04-02 05:13:24 +00:00
Douglas Gregor 3b3e0b3c1e Make darned sure that the -fixit tests are testing what we want them to test
llvm-svn: 68289
2009-04-02 04:59:27 +00:00
Chris Lattner 49836b448e fix a FIXME, providing accurate source range info for DeclStmt's. The end
of the range is now the ';' location.  For something like this:

$ cat t2.c 

#define bool int
void f(int x, int y) {
bool b = !x && y;
}

We used to produce:
$ clang-cc t2.c -ast-dump 
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
  (DeclStmt 0x2201ef0 <line:2:14>                   <----
    0x2201a20 "int b =
      (BinaryOperator 0x2201ed0 <line:4:10, col:16> 'int' '&&'
        (UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
          (DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
        (DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")


Now we produce:

$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
  (DeclStmt 0x2201ef0 <line:2:14, line:4:17>         <------
    0x2201a20 "int b =
      (BinaryOperator 0x2201ed0 <col:10, col:16> 'int' '&&'
        (UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
          (DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
        (DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")

llvm-svn: 68288
2009-04-02 04:16:50 +00:00
Ted Kremenek a2a735e7fa Add another null pointer check. Simplify condition.
llvm-svn: 68283
2009-04-02 03:44:00 +00:00
Ted Kremenek 7f905c2f0d Fix grammar.
llvm-svn: 68282
2009-04-02 03:42:38 +00:00
Ted Kremenek 5d6d7d8184 Add null pointer check.
llvm-svn: 68281
2009-04-02 03:30:55 +00:00
Anders Carlsson f7e01ffa4a When compiling C++ code, always mangle the names of static block var decls.
llvm-svn: 68280
2009-04-02 03:29:47 +00:00
Douglas Gregor 7e70204613 Update comments in fixit tests
llvm-svn: 68279
2009-04-02 03:20:30 +00:00
Douglas Gregor 862ffb11d5 Clean up -fixit output slightly
llvm-svn: 68278
2009-04-02 03:14:12 +00:00
Chris Lattner 720683752e fix overflow checks in SmallVector:
"The code was doing "if (End+NumInputs > Capacity) ...". If End is
close to 0xFFFFFFFF and NumInputs is large, it'll overflow, the
condition will come out false, and the vector won't grow to
accommodate the new elements, and the program will crash in memmove."

Patch by Jeffrey Yasskin!

llvm-svn: 68277
2009-04-02 03:06:26 +00:00
Ted Kremenek 9335fecc2a Update expected warning in test case.
llvm-svn: 68276
2009-04-02 02:52:13 +00:00
Ted Kremenek 6c3413c74a More title-casing of bug type names.
llvm-svn: 68275
2009-04-02 02:44:03 +00:00
Ted Kremenek d7c0872653 Title-case the names of bug types.
llvm-svn: 68274
2009-04-02 02:40:45 +00:00
Ted Kremenek b82dd53988 Title-case the names of bug types.
llvm-svn: 68273
2009-04-02 02:40:26 +00:00
Mike Stump 0be8875ea4 A code modification hint for files that don't end in a newline.
Eventually, would be nice to be able to run these modifications even
when we don't want the warning or errors for the actual diagnostic.

llvm-svn: 68272
2009-04-02 02:29:42 +00:00
Zhongxing Xu 43533c7f40 update docs. Replace 'lattice' with 'tree'.
llvm-svn: 68271
2009-04-02 01:14:56 +00:00
Mike Stump 36c36ebc8b Oops, almost forgot the testcases.
llvm-svn: 68270
2009-04-02 01:14:26 +00:00
Mikhail Glushenkov 12062ba83d Fix build on Linux.
llvm-svn: 68269
2009-04-02 01:11:37 +00:00
Douglas Gregor 578dae57ca Introduce a "-fixit" mode to clang-cc that applies code-modification hints.
llvm-svn: 68268
2009-04-02 01:08:08 +00:00
Mike Stump 40968598c7 Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of a
better name) is the option that SmallTalk can use to intercept all
overflows, including unsigned.  I added some testcases so we don't
break anything.

Also included is another patch from David for += and friends.

llvm-svn: 68267
2009-04-02 01:03:55 +00:00
Ted Kremenek 1e5d9439b8 For plist diagnostics, use the extensive PathDiagnostic generation algorithm.
llvm-svn: 68264
2009-04-02 00:44:18 +00:00
Mike Stump 21c81fdce4 We no longer expect an warning as this is now valid.
llvm-svn: 68263
2009-04-02 00:04:12 +00:00
Owen Anderson 98f912bf13 Reapply r68211, with the miscompilations it caused fixed.
llvm-svn: 68262
2009-04-01 23:53:49 +00:00
Douglas Gregor 170512fa78 Add some more code modification hints
llvm-svn: 68261
2009-04-01 23:51:29 +00:00
Daniel Dunbar 7803c9546b Driver: Allow -ccc-gcc-name to specify the name/path to use when
calling gcc in generic configurations.

llvm-svn: 68260
2009-04-01 23:34:41 +00:00
Fariborz Jahanian e4fd640147 Fix a bug in declaration of property in continuation
class which was exposed by implementation of 
objc2's nonfragile abi code gen.

llvm-svn: 68259
2009-04-01 23:23:53 +00:00
Bill Wendling 66b3fffa60 Make the constants fit.
llvm-svn: 68258
2009-04-01 22:44:18 +00:00
Douglas Gregor e3e01a20d0 Add code modification hints to various parsing-related diagnostics.
Plus, reword a extension warnings to avoid talking about "ISO C" when
the extension might also be available in C++ or C++0x. 

llvm-svn: 68257
2009-04-01 22:41:11 +00:00
Devang Patel ec9c58f7e5 Clean up pass manager cache after each run.
llvm-svn: 68254
2009-04-01 22:34:41 +00:00
Chris Lattner d2eb0a63a1 silence warning in release-asserts build.
llvm-svn: 68253
2009-04-01 22:14:45 +00:00
Daniel Dunbar 4abd56677d Add llvm::Triple class for abstracting access to target triples.
- The code is silly, I'm just amusing myself. Rewrite to be efficient
   if you like. :)

Also, if you wish to debate the proper names of the triple components
I'm all ears.

llvm-svn: 68252
2009-04-01 21:53:23 +00:00
Douglas Gregor fe3d7d0880 Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.

Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.

This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.

llvm-svn: 68251
2009-04-01 21:51:26 +00:00
Misha Brukman 7182686dbf Fixed file header comment.
llvm-svn: 68250
2009-04-01 21:37:19 +00:00
Misha Brukman 1757a810ce Added tests for math utility functions; fixed another test's header comment.
llvm-svn: 68249
2009-04-01 21:36:40 +00:00
Misha Brukman cb943df724 Fixed spelling.
llvm-svn: 68248
2009-04-01 21:33:08 +00:00
Steve Naroff 0f55fd9f33 Update test case and comment.
llvm-svn: 68247
2009-04-01 21:27:56 +00:00
Devang Patel e2ff483afd Remove dead code.
llvm-svn: 68246
2009-04-01 21:27:08 +00:00
Steve Naroff 8d816d6cb5 CodeGenModule::GetAddrOfConstantCFString():
- Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants.

Remove warning from CheckObjCString.

As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling).

llvm-svn: 68245
2009-04-01 21:16:31 +00:00
Ted Kremenek afb066d1f5 BugReporter, extensive path-diagnostics: add an extra control-flow edge to the
enclosing statement when jumping to a subexpression.

llvm-svn: 68244
2009-04-01 21:12:06 +00:00
Chris Lattner d978cc5c63 add this to SVN to allow collaborative hacking.
llvm-svn: 68243
2009-04-01 21:11:04 +00:00
Daniel Dunbar 0a05d93ed6 Quick and dirty (!) fix to make sure we use powerpc in triples.
- PR3922

 - I have a clean solution for this in flight, but it may take a while
   to come to fruition so we'll take a quick fix for now.

llvm-svn: 68241
2009-04-01 20:33:11 +00:00
Mike Stump 0c61b7322a Add -ftrapv support, patch from David Chisnall; well all except the
clang option code that is and two bug fixes.

llvm-svn: 68240
2009-04-01 20:28:16 +00:00
Chris Lattner 807a0f207d Add range insert method for DenseSet and define DenseMapInfo for chars.
Patch by Kevin Fan!

llvm-svn: 68239
2009-04-01 19:50:49 +00:00
Fariborz Jahanian c2d5618083 Fixes a problem where the compiler is reporting the wrong size to the Gnu
runtime on 64-bit architectures.
Patch by David Chisnall

llvm-svn: 68238
2009-04-01 19:49:42 +00:00
Ted Kremenek 95af35e251 Fix comment.
llvm-svn: 68236
2009-04-01 19:43:28 +00:00
Daniel Dunbar 35b0c52add Allow CCC_ADD_ARGS to add empty arguments
llvm-svn: 68235
2009-04-01 19:38:07 +00:00