Commit Graph

1213 Commits

Author SHA1 Message Date
Ted Kremenek 5d61614eab Adjust clang_annotateTokens() to correctly account for the TypeSourceInfo for DeclaratorDecls
when annotating tokens.  Fixes <rdar://problem/7971430>.

llvm-svn: 103577
2010-05-12 05:29:33 +00:00
Abramo Bagnara 6150c884df Merged Elaborated and QualifiedName types.
llvm-svn: 103517
2010-05-11 21:36:43 +00:00
Ted Kremenek 37c220c8ed Extend C++ usrs to include type mangling for tag decl arguments, indicating whether a method
is static, and mangling in the qualifers of the method.

llvm-svn: 103289
2010-05-07 20:39:40 +00:00
Ted Kremenek dacfc2eee6 Switch USR generation over from NamedDecl::getNameAsString() to NamedDecl::printName().
llvm-svn: 103285
2010-05-07 20:07:23 +00:00
Douglas Gregor 542ad31597 Add a stub frontend action for BoostCon, for next week's workshop.
llvm-svn: 103258
2010-05-07 15:41:56 +00:00
Ted Kremenek 586ff60cfc Add initial USR support for mangling in the types of C++ functions and methods.
llvm-svn: 103225
2010-05-07 01:04:32 +00:00
Ted Kremenek b80cba5d7d Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
llvm-svn: 103224
2010-05-07 01:04:29 +00:00
Ted Kremenek 0b4b46e3e1 Add USR support for C++ namespaces, and unify mangling of location information in USRs
for anonymous symbols.

llvm-svn: 103212
2010-05-06 23:38:28 +00:00
Ted Kremenek bd67fb208d Add CXCursor support for C++ namespaces.
llvm-svn: 103211
2010-05-06 23:38:21 +00:00
Ted Kremenek 680fe51e2c Rework clang_annotateTokens() to annotate tokens with information that more closely matches
clang_getCursor().  Tokens are now annotated with the cursor (for the matching AST element)
that most closely encompasses that token.

llvm-svn: 103064
2010-05-05 00:55:23 +00:00
Ted Kremenek 15cbc3a8a5 Map Objective-C keywords to CXToken_Keyword.
llvm-svn: 103063
2010-05-05 00:55:20 +00:00
Ted Kremenek 458c2f190a Move post-processing of token annotations to method in AnnotateTokensWorker.
llvm-svn: 103062
2010-05-05 00:55:17 +00:00
Ted Kremenek 63ac5999f1 Refactor visitor logic for clang_annotateTokens() into a worker class. No functionality change yet.
llvm-svn: 103061
2010-05-05 00:55:15 +00:00
Daniel Dunbar 832fc4a098 Fix NON_ANSI_COMPILE_FLAGS setting, for MSVC.
llvm-svn: 102811
2010-05-01 00:06:42 +00:00
Daniel Dunbar d5a2a073a0 Rename 'CIndex' to 'libclang', since it has basically become our stable public
(C) API, and will likely grow further in this direction in the future.

llvm-svn: 102779
2010-04-30 21:51:10 +00:00
Douglas Gregor 0925fbc3fd Teach clang_getLocation() to cope with a NULL file argument.
llvm-svn: 102748
2010-04-30 19:45:53 +00:00
Daniel Dunbar 9f84c7b600 Move include installation steps to better location, inside each include dir instead of at the top-level.
Also, don't set NO_INSTALL=1 for c-index-test.

llvm-svn: 102724
2010-04-30 17:59:38 +00:00
Ted Kremenek 3b9ad93a35 Add USR support for 'static inline' functions (which can be declared in header files).
Add USR support for 'static' functions and local variables, which can be handy for resolving named variables within a translation unit.

llvm-svn: 102641
2010-04-29 17:43:29 +00:00
Ted Kremenek 9825536eea Remove USRGenerator::VisitBlockDecl(). We don't need to generate USRs for blocks, since
they have no linkage and by definition are anonymous.

llvm-svn: 102640
2010-04-29 17:43:26 +00:00
Douglas Gregor 882211c1da Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

  1) CodeGen cannot handle the case where __builtin_offsetof is not a
  constant expression, so it produces an error. So, to avoid
  regressing in C, we retain the old UnaryOperator-based
  __builtin_offsetof implementation in C while using the shiny new
  OffsetOfExpr implementation in C++. The old implementation can go
  away once we have proper CodeGen support for this case, which we
  expect won't cause much trouble in C++.

  2) __builtin_offsetof doesn't work well with non-POD class types,
  particularly when the designated field is found within a base
  class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests. 

llvm-svn: 102542
2010-04-28 22:16:22 +00:00
Douglas Gregor a9f7c3263e CMake: Fix DESTDIR-related installation problem on Windows, from the
mysterious Elrood on IRC.

llvm-svn: 102435
2010-04-27 16:14:06 +00:00
Douglas Gregor ff1915208d Make TemplateDecl and ObjCContainerDecl abstract
llvm-svn: 102145
2010-04-22 23:35:25 +00:00
Zhongxing Xu 105dfb5a72 CXXNamedCastExpr is actually an abstract expression.
llvm-svn: 101994
2010-04-21 06:32:25 +00:00
Douglas Gregor 9a12919421 Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

  1) Send to a object instance described by an expression (e.g., [x method:5])
  2) Send to a class described by the class name (e.g., [NSString method:5])
  3) Send to a superclass class (e.g, [super method:5] in class method)
  4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

  1) Unchanged; the object instance is represented by an Expr*.

  2) Previously stored the ObjCInterfaceDecl* referring to the class
  receiving the message. Now stores a TypeSourceInfo* so that we know
  how the class was spelled. This both maintains typedef information
  and opens the door for more complicated C++ types (e.g., dependent
  types). There was an alternative, unused representation of these
  sends by naming the class via an IdentifierInfo *. In practice, we
  either had an ObjCInterfaceDecl *, from which we would get the
  IdentifierInfo *, or we fell into the case below...

  3) Previously represented by a class message whose IdentifierInfo *
  referred to "super". Sema and CodeGen would use isStr("super") to
  determine if they had a send to super. Now represented as a
  "class super" send, where we have both the location of the "super"
  keyword and the ObjCInterfaceDecl* of the superclass we're
  targetting (statically).

  4) Previously represented by an instance message whose receiver is a
  an ObjCSuperExpr, which Sema and CodeGen would check for via
  isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
  where we have both the location of the "super" keyword and the
  ObjCInterfaceDecl* of the superclass we're targetting
  (statically). Note that ObjCSuperExpr only has one remaining use in
  the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

  if (message has a receiver expression) {
    // instance message
    if (isa<ObjCSuperExpr>(...)) {
     // send to super
    } else {
     // send to an object
   }
  } else {
    // class message
    if (name->isStr("super")) {
      // class send to super
    } else {
      // send to class
    }
  }

with a switch

  switch (E->getReceiverKind()) {
  case ObjCMessageExpr::SuperInstance: ...
  case ObjCMessageExpr::Instance: ...
  case ObjCMessageExpr::SuperClass: ...
  case ObjCMessageExpr::Class:...
  }

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.

llvm-svn: 101972
2010-04-21 00:45:42 +00:00
Ted Kremenek 6d159c1060 Fix USRs for 'extern' variables declaration in functions/method bodies.
Fix USRs for @synthesize.
Add more USR tests.

llvm-svn: 101954
2010-04-20 23:15:40 +00:00
Douglas Gregor abd9e9689a Keep proper source location information for the type in an Objective-C
@encode expression. 

llvm-svn: 101907
2010-04-20 15:39:42 +00:00
Dan Gohman 145f3f1e83 Fix -Wcast-qual warnings.
llvm-svn: 101786
2010-04-19 16:39:44 +00:00
Benjamin Kramer b11416d061 Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.

llvm-svn: 101632
2010-04-17 09:33:03 +00:00
Ted Kremenek cab334cc90 Send code completion data in json format.
llvm-svn: 101586
2010-04-17 00:21:42 +00:00
Ted Kremenek 551c178efc Remove unneeded assertion and don't return a null CXString.
llvm-svn: 101585
2010-04-17 00:21:38 +00:00
Ted Kremenek 7afa85b8fa Rework USR generation for symbols with no linkage. Many of the USRs are now shortened,
and we now include the file name that declares the symbol with no linkage in the USR.
USRs for such symbols are generated only in restructed cases, e.g., anonymous enum declarations,
typedefs, etc.

llvm-svn: 101542
2010-04-16 21:31:52 +00:00
Dan Gohman 314ca58a91 Convert libCIndex to use the new native EXPORTED_SYMBOL_FILE mechanism.
libCIndex also has a CMakeLists.txt file which has its own code for using
the exports file. To preserve existing functionality, create a separate
darwin-specific exports file for use by this CMakeLists.txt code.

llvm-svn: 101440
2010-04-16 04:45:02 +00:00
Ted Kremenek a96a8eebbb Better support USRs for anonymous enums, structs, by including the location where
the tag was declared.  WIP.

llvm-svn: 101403
2010-04-15 21:51:13 +00:00
Ted Kremenek 9833d399ce Do not generate USRs for declarations with 'no linkage' except for enums, structs, typedefs.
Those still need work to disambiguate them across translation units.

llvm-svn: 101401
2010-04-15 21:04:25 +00:00
Daniel Dunbar 76fa840d09 Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

llvm-svn: 101354
2010-04-15 06:09:03 +00:00
Ted Kremenek 9e0cf0978c Add optional timing logging for code completion results. This causes a UDP packet
containing the time taken for the code completion to be sent to a designated server
(which is specified using a compile-time -D flag).

llvm-svn: 101326
2010-04-15 01:02:28 +00:00
Ted Kremenek 225b8e39f1 Add cursor kind for C++ methods.
llvm-svn: 101193
2010-04-13 23:39:06 +00:00
Ted Kremenek 4ed2925b91 Add 'clang_getCursorLanguage' to return the "language" of the AST element (e.g., distinguish between C and Objective-C language features). Currently this only returns results for declarations.
llvm-svn: 101070
2010-04-12 21:22:16 +00:00
Ted Kremenek 601f6d5b59 Sort exports file.
llvm-svn: 101069
2010-04-12 21:22:10 +00:00
Benjamin Kramer 0644145373 Prune includes.
llvm-svn: 101059
2010-04-12 19:45:50 +00:00
Ted Kremenek 2908a20d86 Add initial USR support for macro definitions.
llvm-svn: 100997
2010-04-11 22:20:34 +00:00
Ted Kremenek 74c4389ea6 Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does the right
thing if the cursor is not a decl (such as in the case of macros).

llvm-svn: 100996
2010-04-11 22:20:26 +00:00
Ted Kremenek 33b9a42f41 Add CIndex support for blocks.
llvm-svn: 100989
2010-04-11 21:47:37 +00:00
Benjamin Kramer 31160e8469 CIndex: move extractUSRSuffix out of extern "C" and simplify it.
llvm-svn: 100773
2010-04-08 15:54:07 +00:00
Daniel Dunbar 8ee6760971 Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.
llvm-svn: 100747
2010-04-08 02:59:56 +00:00
Chris Lattner 1f054ecca2 update for api change.
llvm-svn: 100718
2010-04-07 23:12:35 +00:00
Ted Kremenek 6ca136a77f Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.
llvm-svn: 100589
2010-04-07 00:27:13 +00:00
Ted Kremenek 7deb7050d5 Fix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
llvm-svn: 100551
2010-04-06 19:41:24 +00:00
Chris Lattner 6d67213ebb reduce indentation, tidy.
llvm-svn: 100537
2010-04-06 17:52:14 +00:00
Douglas Gregor 7f95d26e53 Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.

llvm-svn: 100498
2010-04-05 23:52:57 +00:00
Chris Lattner 61955ab200 inline in MC assembly parsers. clang -integrated-as now
works with inline asm!

llvm-svn: 100493
2010-04-05 23:33:20 +00:00
Chris Lattner 58c79341ab Match MemoryBuffer API changes.
llvm-svn: 100484
2010-04-05 22:42:27 +00:00
Douglas Gregor d03e823fb4 Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.

llvm-svn: 100464
2010-04-05 21:10:19 +00:00
Douglas Gregor a2433154c8 Minor ASTUnit cleanups:
- Rename "Diagnostics" and related to "StoredDiagnostics", to better
  capture what we're actually storing.
  - Move SourceManager and FileManager to the heap.

llvm-svn: 100441
2010-04-05 18:10:21 +00:00
Douglas Gregor f3df985ba7 Code completion results that refer to macros now get the cursor kind
of macro definitions when passed to CIndex. Add test for code
completion of macros via CIndex.

llvm-svn: 100431
2010-04-05 16:10:30 +00:00
Daniel Dunbar e43887bd2b Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Douglas Gregor a771f46c82 Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".

llvm-svn: 100022
2010-03-31 17:46:05 +00:00
Douglas Gregor 30e631862f Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
llvm-svn: 100018
2010-03-31 17:25:35 +00:00
Douglas Gregor 3baad0d4f7 Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.

llvm-svn: 100008
2010-03-31 15:31:50 +00:00
Douglas Gregor 171b780c91 Teach Clang's -cc1 option -print-stats to print LLVM statistics.
llvm-svn: 99894
2010-03-30 17:33:59 +00:00
Chris Lattner 09f8cc8c70 make -ftime-report work even in -disable-free mode. Woo, finally.
rdar://7781603

llvm-svn: 99878
2010-03-30 05:39:52 +00:00
Ted Kremenek d76197a271 scan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link projects
with c++ code.

llvm-svn: 99684
2010-03-27 00:20:01 +00:00
Ted Kremenek 014e70b797 Return translation units from clang_createTranslationUnitFromSource()
if even they contain errors.

llvm-svn: 99594
2010-03-26 01:34:51 +00:00
Ted Kremenek 599d73aa72 Add c-index-test support for printing USRs.
llvm-svn: 99476
2010-03-25 02:00:39 +00:00
Ted Kremenek f64a38907d Require that all Clang-based USRs start with the prefix 'c:' for the "USR space".
llvm-svn: 99475
2010-03-25 02:00:36 +00:00
Douglas Gregor 023da0d43a Make sure that we have File IDs for all of the unsaved files before we
deserialize diagnostics.

llvm-svn: 99426
2010-03-24 21:04:06 +00:00
Daniel Dunbar 30b24e95fa Frontend: Don't free the CompilerInstance or FrontendActions when running under
-disable-free. Among other things, this fixes freeing of the LLVM module on
exit.
 - Note that this means we are disable-free'ing of a lot more stuff than we used to -- this should flush out bugs in anything left that is trying to do real work in its destructor. I did a mini-audit but '::~' is not totally uncommon.

llvm-svn: 99258
2010-03-23 05:09:16 +00:00
Douglas Gregor 7bf6b8a416 Use the cursor's ASTContext rather than the ASTContext computed from a
declaration, just in case invalid code makes the latter
incorrect. This may be the cause behind <rdar://problem/7777070>.

llvm-svn: 99179
2010-03-22 15:53:50 +00:00
Kovarththanan Rajaratnam a0170209af Use DEFINE_SYMBOL property to control dllexport/dllimport
llvm-svn: 99176
2010-03-22 15:44:38 +00:00
Daniel Dunbar 6a8efa8a79 Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.
llvm-svn: 99054
2010-03-20 08:01:59 +00:00
Daniel Dunbar aef1db1d71 Fix unused variable warning.
llvm-svn: 99021
2010-03-20 01:11:56 +00:00
Douglas Gregor 3dc10b530e Optimize region-of-interest based cursor walks through the
preprocessed entities by grouping preprocessed entities by file
ID. This drastically improves performance of repeated
clang_getCursor() calls local tests, although it is a bit ugly.

llvm-svn: 99015
2010-03-20 00:41:21 +00:00
Douglas Gregor aae9224e49 Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.

llvm-svn: 99002
2010-03-19 21:51:54 +00:00
Ted Kremenek 00da3b9a80 Teach clang_getCursorKindSpelling() about CXCursor_InvalidCode.
llvm-svn: 98982
2010-03-19 20:39:05 +00:00
Ted Kremenek e184ac5a66 Make the CIndex API more resilient to being used on invalid code.
llvm-svn: 98981
2010-03-19 20:39:03 +00:00
Daniel Dunbar 1c201fbf73 clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
actual action.
 - This is easier to use, and more reliable for timing the thing this was
   actually meant to be useful for.

llvm-svn: 98978
2010-03-19 19:44:04 +00:00
Douglas Gregor 7f6d60dcc2 Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.

llvm-svn: 98963
2010-03-19 16:15:56 +00:00
Douglas Gregor 5272e80ce5 Visit preprocessing elements (macro instantiations and macro
definitions) as part of the translation unit, so that normal
visitation, token-annotation, and cursor-at retrieval all see
preprocessing elements.

llvm-svn: 98935
2010-03-19 05:22:59 +00:00
Bob Wilson 4f559a3042 Revert 98907 since it is breaking buildbots.
--- Reverse-merging r98907 into '.':
D    test/Index/c-index-getCursor-pp.c
U    tools/CIndex/CIndex.cpp

llvm-svn: 98929
2010-03-19 03:57:57 +00:00
Douglas Gregor 20004ee7d2 Visit preprocessing elements (macro instantiations and macro
definitions) as part of the translation unit, so that normal
visitation, token-annotation, and cursor-at retrieval all see
preprocessing elements.

llvm-svn: 98907
2010-03-19 00:18:31 +00:00
Douglas Gregor e56c353eb1 Try to appease MSVC's standard library
llvm-svn: 98878
2010-03-18 21:28:30 +00:00
Douglas Gregor 5810ead358 Try to appease MSVC
llvm-svn: 98875
2010-03-18 21:25:12 +00:00
Douglas Gregor 78ae2481b6 Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.

llvm-svn: 98842
2010-03-18 18:23:03 +00:00
Douglas Gregor 06d6d32762 Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens().

llvm-svn: 98837
2010-03-18 18:04:21 +00:00
Douglas Gregor 065f8d11ca Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.

llvm-svn: 98836
2010-03-18 17:52:52 +00:00
Douglas Gregor 02ded2a56c More token-annotation experimentation, preprocessing the annotated
token sequence to detect macro instantiations (that produce at least
token). WIP.

llvm-svn: 98826
2010-03-18 15:23:44 +00:00
Douglas Gregor 92a524fd47 Experimental stab at using relexing to identify preprocessor
directives while annotating tokens in CIndex. This functionality
should probably be factored out of this routine, but we're not there
yet. 

llvm-svn: 98786
2010-03-18 00:42:48 +00:00
Douglas Gregor 554e0b1ec2 Audit all callers of SourceManager::getBufferData(); fix the one that
needs better error recovery.

llvm-svn: 98667
2010-03-16 20:26:15 +00:00
Benjamin Kramer eb92dc0b09 Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
2010-03-16 14:14:31 +00:00
Douglas Gregor e0fbb83b8b Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.

llvm-svn: 98594
2010-03-16 00:06:06 +00:00
Douglas Gregor 802b77601e Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).

llvm-svn: 98585
2010-03-15 22:54:52 +00:00
Ted Kremenek bc1a67bee3 Rename clang_constructUSR_ObjCategory to clang_constructUSR_ObjCCategory.
(there was a missing 'C').

llvm-svn: 98554
2010-03-15 17:38:58 +00:00
Anton Korobeynikov 762c6b7346 Fix thinko and enable clang build on mingw again (hopefully)
llvm-svn: 98492
2010-03-14 12:55:35 +00:00
Benjamin Kramer f156b9d55d Revert 98439. There is a bad race condition in sys::Path::makeUnique on win32.
llvm-svn: 98452
2010-03-13 21:22:49 +00:00
Benjamin Kramer 84c37f9903 Make getTemporaryPath a static member of CIndexer and use it to replace tmpnam calls.
This fixes linker warnings on linux.

llvm-svn: 98439
2010-03-13 13:05:20 +00:00
Ted Kremenek d071c6019a Implement several CIndex functions for constructing USRs from C-strings instead of AST elements.
llvm-svn: 98421
2010-03-13 02:50:34 +00:00
Jeffrey Yasskin f6442f80cb Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Ted Kremenek ff9021b675 Implement clang_isUnexposed(), a predicate function to simplify filtering out
unexposed AST elements.

llvm-svn: 97985
2010-03-08 21:17:29 +00:00
Ted Kremenek adccbca23f Don't enable static analysis support for C++ by default. Users are
accidentally using it without realizing that it is nowhere close
to being generally usable and are reporting crashes that we
already know about.

llvm-svn: 97960
2010-03-08 19:06:44 +00:00
Kovarththanan Rajaratnam 4bc61181f9 Mark variable as const
llvm-svn: 97951
2010-03-08 18:33:04 +00:00