Commit Graph

400 Commits

Author SHA1 Message Date
Daniel Dunbar 3283ff5088 Put compiler headers in <prefix>/lib/clang/1.0/include (vs
<prefix>/Headers, gross).

llvm-svn: 65247
2009-02-21 20:52:41 +00:00
Chris Lattner 06ef388a61 fix a bug introduced in my previous patch: moving clang headers to the
"after" group instead of the system group makes it so #include <limits.h>
picks up the *system* limits.h file before clang's.  This causes a failure
on linux and is definitely not what we want.

llvm-svn: 65026
2009-02-19 06:48:28 +00:00
Chris Lattner cb60143ec3 always search for "builtin" headers at the end of the search path,
and never remap them with -isysroot.  This fixes PR3614.

llvm-svn: 65012
2009-02-19 04:55:19 +00:00
Chris Lattner f53a9612d1 add a bunch of timers for -E and other modes. This requires
llvm r64874 or later.

llvm-svn: 64875
2009-02-18 01:51:21 +00:00
Chris Lattner deffa13399 move llvm backend specific #includes into Backend.cpp instead of Clang.cpp
llvm-svn: 64872
2009-02-18 01:23:44 +00:00
Chris Lattner baba6fc1c4 indentation and formatting
llvm-svn: 64871
2009-02-18 01:20:05 +00:00
Chris Lattner 5df3d46a9b clang will hopefully never support ratfor.
llvm-svn: 64870
2009-02-18 01:17:01 +00:00
Chris Lattner a1580a603a wire up a minimal -ftime-report, which prints the optimizer/codegen
times.  Daniel, plz add driver support.

llvm-svn: 64869
2009-02-18 01:12:43 +00:00
Daniel Dunbar d97b07e7d4 Backend: Accept -mcpu and -mattr for use by TargetMachine.
llvm-svn: 64798
2009-02-17 19:47:34 +00:00
Ted Kremenek b535181199 Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp.
- Unified specification of stores/constraints/output to be:
   -analyzer-output=...
   -analyzer-store=...
   -analyzer-constraints=...
  instead of -analyzer-range-constraints, -analyzer-store-basic, etc.
- Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new
  interface
- Updated test cases to conform to new driver options

llvm-svn: 64737
2009-02-17 04:27:41 +00:00
Chris Lattner 8a04c5ad03 add support for -fno-math-errno, and validate that it affects sema properly.
llvm-svn: 64708
2009-02-17 00:35:09 +00:00
Chris Lattner ba86ad178b remove extraneous .
llvm-svn: 64706
2009-02-17 00:30:31 +00:00
Daniel Dunbar 8eb018ab9c Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.
- Define pow[lf]?, sqrt[lf]? as builtins.

 - Add -fmath-errno option which binds to LangOptions.MathErrno

 - Add new builtin flag Builtin::Context::isConstWithoutErrno for
   functions which can be marked as const if errno isn't respected for
   math functions. Sema automatically marks these functions as const
   when they are defined, if MathErrno=0.

 - IRgen uses const attribute on sqrt and pow library functions to
   decide if it can use the llvm intrinsic.

llvm-svn: 64689
2009-02-16 22:43:43 +00:00
Daniel Dunbar f898638eee PR3589: Don't simplify libcalls with -ffreestanding.
llvm-svn: 64599
2009-02-15 20:00:15 +00:00
Douglas Gregor 69c7951c8e Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586
llvm-svn: 64566
2009-02-14 20:49:29 +00:00
Chris Lattner f302000e5c add support for -x c++-header, update comment.
llvm-svn: 63924
2009-02-06 06:19:20 +00:00
Chris Lattner fa81669354 default diag::err_pp_file_not_found to mapping to fatal,
implementing PR3492: #include failures should be a fatal error

llvm-svn: 63915
2009-02-06 04:16:41 +00:00
Daniel Dunbar 1e8052b36d Add -femit-all-decls codegen option.
- Emits all declarations, even unused (static) ones.
 - Useful when doing minimization of codegen problems (otherwise
   problems localized to a static function aren't minimized well).

llvm-svn: 63776
2009-02-04 21:19:06 +00:00
Mike Stump f126e59042 Use the updated CommandLine api for -fno-blocks.
llvm-svn: 63563
2009-02-02 22:57:57 +00:00
Anders Carlsson f6e6057e92 Fix typo noticed by Chris.
llvm-svn: 63449
2009-01-30 23:26:40 +00:00
Anders Carlsson db5a9b675c Turn on -flax-vector-conversions by default, issue a warning whenever one is done. Add a -fnolax-vector-conversions option. Fixes PR2862.
llvm-svn: 63447
2009-01-30 23:17:46 +00:00
Chris Lattner 83ab0a83f5 wire up -fno-show-source-location option, patch by Alexei Svitkine!
llvm-svn: 63409
2009-01-30 19:01:41 +00:00
Mike Stump c99d003b25 Add -fno-blocks support. This fixes block-no-block-def.c.
llvm-svn: 63385
2009-01-30 08:22:07 +00:00
Daniel Dunbar 38b9c05f1c Fix name of -x option for C preprocessed input; it should be
cpp-output, not c-cpp-output.

llvm-svn: 63345
2009-01-29 23:50:47 +00:00
Chris Lattner 4b6713ef20 next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc.  Patch by
Anders Johnsen!

llvm-svn: 63318
2009-01-29 17:46:13 +00:00
Chris Lattner 36790cf29a Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.

llvm-svn: 63282
2009-01-29 06:55:46 +00:00
Chris Lattner 0f65a585ba Fix a wart that existed from before we had EXTWARN.
llvm-svn: 63272
2009-01-29 05:23:19 +00:00
Chris Lattner 60f36223a9 move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes.  Patch by Anders Johnsen!

llvm-svn: 63271
2009-01-29 05:15:15 +00:00
Ted Kremenek 3b0589e4b4 Enhance PTHManager::Create() to take an optional Diagnostic* argument that can be used to report issues such as a missing PTH file.
llvm-svn: 63231
2009-01-28 20:49:33 +00:00
Ted Kremenek 062115af59 Patch by Alexei Svitkine: Refactor Sema::ParseAST API to allow clients to pass as an argument a TranslationUnit object whose contents live beyond the call to ParseAST.
llvm-svn: 63175
2009-01-28 04:29:29 +00:00
Mike Stump 5d1ebe90b3 Add a preliminary version number.
llvm-svn: 63168
2009-01-28 02:43:35 +00:00
Chris Lattner 7368d581c1 Split the single monolithic DiagnosticKinds.def file into one
.def file for each library.  This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!

llvm-svn: 63111
2009-01-27 18:30:58 +00:00
Ted Kremenek ec28391084 Added clang option '--analyzer-display-progress' to indicate that the analyzer should output 'ANALYZE:' messages to display its progress on a source file.
llvm-svn: 62875
2009-01-23 20:52:26 +00:00
Ted Kremenek 099243aa9e When using -analyzer-output-plist always output a plist file even if it contains no error reports.
llvm-svn: 62871
2009-01-23 20:06:20 +00:00
Fariborz Jahanian b15a3d5969 Use NonFragileABI as name of new Next abi. More comments
for the new meta-data.

llvm-svn: 62806
2009-01-22 23:02:58 +00:00
Chris Lattner 8c5ffd0761 Adjust to api change.
llvm-svn: 62785
2009-01-22 20:57:52 +00:00
Fariborz Jahanian 279eda6275 Refactoring ObjC Next's runtime classes in preparation for
the new ObjC's abi.

llvm-svn: 62721
2009-01-21 22:04:16 +00:00
Anders Carlsson e26b945b8d Don't turn off blocks when compiling Obj-C code
llvm-svn: 62701
2009-01-21 18:47:36 +00:00
Daniel Dunbar 34fc92fdc2 Add -analyze action to run static analyzer, instead of inferring from
individual checker options.

llvm-svn: 62634
2009-01-20 23:17:32 +00:00
Chris Lattner 08354fef13 add a simplified lexer ctor that sets up the lexer to raw-lex an
entire file.

llvm-svn: 62414
2009-01-17 07:35:14 +00:00
Chris Lattner d32480d3db this massive patch introduces a simple new abstraction: it makes
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.

This is an important distinction from the "FileID" currently tracked by
SourceLocation.  *That* FileID may refer to the start of a file or to a
chunk within it.  The new FileID *only* refers to the file (and its 
#include stack and eventually #line data), it cannot refer to a chunk.

FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.

llvm-svn: 62407
2009-01-17 06:22:33 +00:00
Ted Kremenek a705b04d7f IdentifierInfo:
- IdentifierInfo can now (optionally) have its string data not be
  co-located with itself.  This is for use with PTH.  This aspect is a
  little gross, as getName() and getLength() now make assumptions
  about a possible alternate representation of IdentifierInfo.
  Perhaps we should make IdentifierInfo have virtual methods?

IdentifierTable:
- Added class "IdentifierInfoLookup" that can be used by
  IdentifierTable to perform "string -> IdentifierInfo" lookups using
  an auxilliary data structure.  This is used by PTH.
- Perform tests show that IdentifierTable::get() does not slow down
  because of the extra check for the IdentiferInfoLookup object (the
  regular StringMap lookup does enough work to mitigate the impact of
  an extra null pointer check).
- The upshot is that now that some IdentifierInfo objects might be
  owned by the IdentiferInfoLookup object.  This should be reviewed.

PTH:
- Modified PTHManager::GetIdentifierInfo to *not* insert entries in
  IdentifierTable's string map, and instead create IdentifierInfo
  objects on the fly when mapping from persistent IDs to
  IdentifierInfos.  This saves a ton of work with string copies,
  hashing, and StringMap lookup and resizing.  This change was
  motivated because when processing source files in the PTH cache we
  don't need to do any string -> IdentifierInfo lookups.
- PTHManager now subclasses IdentifierInfoLookup, allowing clients of
  IdentifierTable to transparently use IdentifierInfo objects managed
  by the PTH file.  PTHManager resolves "string -> IdentifierInfo"
  queries by doing a binary search over a sorted table of identifier
  strings in the PTH file (the exact algorithm we use can be changed
  as needed).

These changes lead to the following performance changes when using PTH on Cocoa.h:
- fsyntax-only: 10% performance improvement
- Eonly: 30% performance improvement

llvm-svn: 62273
2009-01-15 18:47:46 +00:00
Daniel Dunbar 1dad2d8e8b Fix typo and spelling of -Wunused-macros.
llvm-svn: 62239
2009-01-14 18:56:36 +00:00
Zhongxing Xu 9aabf025e5 Add an initial framework of a DeclContextPrinter. It can print DeclContext and
its Decls in indented format. An Example:

$ cat t.cpp
class A {
  int a;
  void f();
};
void A::f() {
  a = 3;
}

$ clang -print-decl-contexts t.cpp
[translation unit] 0x9754d7c
    <typedef> __builtin_va_list
    [class] A 0x9753310
        <class> A 0x975ce20
        <field> a
        <c++ method> f
        <c++ ctor> A
        <c++ ctor> A
        <c++ method> operator=
        <c++ dtor> ~A
    [c++ method] f [[0x9753310]]

Some comments: '<>' indicates a declaration, '[]' indicates a definition, '[[
]]' displays the semantic DeclContext which is different from the lexical
DeclContext.  The symbols printed can definitely be changed in the future.

llvm-svn: 62136
2009-01-13 01:29:24 +00:00
Douglas Gregor c6f58fe266 Implement support for anonymous structs and unions in C. Both C and
C++ handle anonymous structs/unions in the same way. Addresses several
bugs:

  <rdar://problem/6259534>
  <rdar://problem/6481130>
  <rdar://problem/6483159>

The test case in PR clang/1750 now passes with -fsyntax-only, but
CodeGen for inline assembler still fails.

llvm-svn: 62112
2009-01-12 22:49:06 +00:00
Ted Kremenek feb260784b Always print out SourceManager stats with 'Stats' is true. This revealed that PTH always pulls in the source pages with -fsyntax-only (investigating further).
llvm-svn: 61996
2009-01-09 18:20:21 +00:00
Ted Kremenek b54c19a754 Enable support for '-x objective-c++-header'.
llvm-svn: 61963
2009-01-09 00:38:08 +00:00
Fariborz Jahanian d11dc0b1d9 Place warning about 'readonly' property attributes which
are related to setter syntax under -Wreadonly-setter-attrs
to prevent warnings in projects built with gcc.

llvm-svn: 61953
2009-01-08 23:23:10 +00:00
Ted Kremenek 63a55ab079 Remove redunant (and incorrect) call to SourceManager::PrintStats(). This would be called after a SourceManager was 'cleared', so it printed bogus results. Moreover, these stats are already printed earlier in the code path.
llvm-svn: 61825
2009-01-06 22:16:26 +00:00
Daniel Dunbar 7b127324ce Force i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.
Only use major part of OS version when on darwin and modifying OS part
of target triple.

llvm-svn: 60957
2008-12-12 18:34:35 +00:00