Commit Graph

6568 Commits

Author SHA1 Message Date
Ted Kremenek 0b86e3a72d Implement 'clang_getInclusions()' in CIndex. This API allows clients to walk the set of files included in a translation unit via the C API.
llvm-svn: 94575
2010-01-26 19:31:51 +00:00
Douglas Gregor 9bd6db5834 Eliminate clang_getInstantiationLocationOffset(), and instead add an
offset parameter to clang_getInstantiationLocation(). 

llvm-svn: 94573
2010-01-26 19:19:08 +00:00
Douglas Gregor 6165611986 Implement clang_annotateTokens(), which associates cursors with each
of the tokens within a raw token stream. This does not even attempt to
handle macros yet.

llvm-svn: 94561
2010-01-26 18:31:56 +00:00
Anders Carlsson ca4a5459d8 Use the right definition when emitting a global variable. Fixes PR5564.
llvm-svn: 94555
2010-01-26 17:43:42 +00:00
Ken Dyck a6046ab82b Correct cut-and-paste error in doxygen comment for newly introduced
getTypeAlignInChars().  

llvm-svn: 94553
2010-01-26 17:25:18 +00:00
Ken Dyck 24d28d6cde Add getTypeAlignInChars() for use in code that works in alignments in character
units.

llvm-svn: 94552
2010-01-26 17:22:55 +00:00
Douglas Gregor 27b4fa994d Introduce a CIndex API for lexing the raw tokens within a given source
range. The token-annotation function does nothing, yet.

llvm-svn: 94551
2010-01-26 17:06:03 +00:00
Ken Dyck 86a8c957da Replace inheritance of RegionRawOffset from std::pair with two private member
variables to improve readability and encapsulation.

llvm-svn: 94550
2010-01-26 17:01:47 +00:00
John McCall 1f6386b79b Avoid some unnecessary copying of unresolved lookup results.
llvm-svn: 94531
2010-01-26 07:37:41 +00:00
John McCall 4c4c1dfc2b Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.

llvm-svn: 94498
2010-01-26 03:27:55 +00:00
Douglas Gregor 47751d6c21 Introduce clang_getInstantiationLocationOffset(), which decomposes a
source location in file + offset.

llvm-svn: 94497
2010-01-26 03:07:15 +00:00
Daniel Dunbar d54669d30b Driver/Darwin: Honor IPHONEOS_DEPLOYMENT_TARGET.
llvm-svn: 94488
2010-01-26 01:45:19 +00:00
John McCall 9dfb16210e Warn on top-level 'asm volatile' (instead of misparsing it).
"Fixes" rdar://problem/7574870

llvm-svn: 94458
2010-01-25 22:27:48 +00:00
Ted Kremenek fe0fc40c3b Move BugReporter.h, PathDiagnostic.h, and BugType.h to 'include/Checker/BugReporter'
llvm-svn: 94428
2010-01-25 17:10:22 +00:00
Ted Kremenek b2c9aa6cbc Add missing header.
llvm-svn: 94409
2010-01-25 05:19:37 +00:00
Ted Kremenek d6b8708643 Split libAnalysis into two libraries: libAnalysis and libChecker.
(1) libAnalysis is a generic analysis library that can be used by
    Sema.  It defines the CFG, basic dataflow analysis primitives, and
    inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
    path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker.  More changes pending.  :)

This change also exposed a layering violation between AnalysisContext
and MemRegion.  BlockInvocationContext shouldn't explicitly know about
BlockDataRegions.  For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet).  We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.

llvm-svn: 94406
2010-01-25 04:41:41 +00:00
Daniel Dunbar fcf2d428e4 ASTUnit: Don't check that input files exist when parsing ASTs from the command
line -- they may be remapped (fake) files. This is useful for testing parsing
entirely from memory.

llvm-svn: 94395
2010-01-25 00:44:02 +00:00
Daniel Dunbar d01592617f Update comment.
llvm-svn: 94393
2010-01-25 00:43:14 +00:00
Anders Carlsson 6515d877c0 Fix a pretty bad bug where if a constructor (or conversion function) was marked as 'explicit', but then defined out-of-line, we would not treat it as being explicit.
llvm-svn: 94366
2010-01-24 17:15:04 +00:00
Anders Carlsson 77babdb99a Implement [dcl.fct.spec]p6.
llvm-svn: 94365
2010-01-24 16:49:46 +00:00
Mike Stump 20a2c618f2 Ok, turn back off -Wunreachable-code by default.
llvm-svn: 94364
2010-01-24 16:16:01 +00:00
Sebastian Redl 0432dcd15c Mark PartialDiagnostic.h as a C++ header
llvm-svn: 94363
2010-01-24 10:02:25 +00:00
Anders Carlsson aaeef07280 Implement instantiation of AsmStmts (Crazy, I know)
llvm-svn: 94361
2010-01-24 05:50:09 +00:00
Daniel Dunbar b9999fdc67 Tweak clang_visitChildren comment.
llvm-svn: 94360
2010-01-24 04:10:31 +00:00
Daniel Dunbar 62ebf25f44 Index.h: Tweak comments, delete trailing whitespace, fix a few typos, etc.
llvm-svn: 94351
2010-01-24 02:54:26 +00:00
Chris Lattner 8fd2d01118 fix PR6034, a crash on invalid where the switch stack would get
unbalanced.

llvm-svn: 94347
2010-01-24 01:50:29 +00:00
Chris Lattner 11092645da add a prototype for __builtin_fpclassify. We don't know how to
codegen it, so we get 'cannot compile this builtin function yet'
errors, just like we do currently for __builtin_isinf.  However,
this should let us parse headers that use it without barfing,
which should help PR6083.

llvm-svn: 94346
2010-01-24 01:30:04 +00:00
Anders Carlsson 0bd52403d4 Use new initialization code when dealing with [dcl.init.aggr]p12. This fixes the bug where array elements and member initializers weren't copied correctly.
llvm-svn: 94340
2010-01-24 00:19:41 +00:00
Mike Stump 38013e109e Temporary flip default for -Wunreachable-code so some bots can test it
out.  They should all be done later tonight, but if something bad
happens, feel free to revert sooner.

llvm-svn: 94330
2010-01-23 20:23:40 +00:00
Eli Friedman d6ef69a7db Add bzero builtin; this should help codegen quality for code using this
function.

llvm-svn: 94320
2010-01-23 19:00:10 +00:00
Anders Carlsson 7802f31bfc Fix typo.
llvm-svn: 94315
2010-01-23 18:26:49 +00:00
Ted Kremenek 3e315a28b1 Add doxygen comment to clang_getClangVersion().
llvm-svn: 94311
2010-01-23 17:51:23 +00:00
John McCall 6d174646dd Produce a special diagnostic when users call a function with an argument of
incomplete type (or a pointer/reference to such).

The causes of this problem are different enough to justify a different "design"
for the diagnostic.  Most notably, it doesn't give an operand index:
it's usually pretty obvious which operand is the problem, it adds a lot of
clutter to mention it, and the fix is usually in a different part of the file
anyway.

This is yet another diagnostic that should really have an analogue in the
non-overloaded case --- which should be much easier to write because of
the weaker space constraints.

llvm-svn: 94303
2010-01-23 08:10:49 +00:00
Anders Carlsson 8e01dcf6f6 Fix the EntityKind order so that all entity kinds that can be copied (using copy constructors) come first. Also, fix a bug where EK_New was left out of the err_init_conversion_failed diagnostic (It is now reported as 'new value'). Please review Doug :)
llvm-svn: 94289
2010-01-23 05:47:27 +00:00
David Chisnall 481e3a87fe Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.
llvm-svn: 94274
2010-01-23 02:40:42 +00:00
Ted Kremenek 4c0df3dc1d Rename getClangFullVendorVersion() to getClangFullVersion().
llvm-svn: 94273
2010-01-23 02:11:34 +00:00
John McCall 553c0796ee Implement elementary access control.
llvm-svn: 94268
2010-01-23 00:46:32 +00:00
Douglas Gregor aa98ed9a07 Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.

llvm-svn: 94258
2010-01-23 00:14:00 +00:00
Ted Kremenek c0f3f72fa4 Add 'clang_getClangVersion()' function to CIndex. This exposes the full Clang version string through the CIndex API.
llvm-svn: 94242
2010-01-22 22:44:15 +00:00
Ted Kremenek 51b8bc93f8 Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().
llvm-svn: 94235
2010-01-22 22:29:50 +00:00
Douglas Gregor 6007cf2e9e Improve content and structure of the Doxygen documentation for the
CIndex API. No functionality change.

llvm-svn: 94234
2010-01-22 22:29:16 +00:00
Ted Kremenek 18e066f6a9 (1) Rename getClangSubversionRevision() to getClangRevision(), and
have it return a StringRef instead of an integer (to be more VCS
    agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
    amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
    getClangFullRepositoryVersion() instead of also emitting the value
    of getClangSubversionRevision() (which has been removed).  This is
    functionally equivalent.

More cleanup to version string generation pending...

llvm-svn: 94231
2010-01-22 22:12:47 +00:00
Douglas Gregor 816fd36316 Yet more CIndex API cleanup:
- Added more routines to manipulate/compare source locations and ranges
  - Switched clang_getCursor() over to take a CXSourceLocation rather
  than file/line/column.

llvm-svn: 94226
2010-01-22 21:44:22 +00:00
Ted Kremenek 17437130e9 Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.
llvm-svn: 94214
2010-01-22 20:59:36 +00:00
Ted Kremenek 2377a0e0ea Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.
llvm-svn: 94213
2010-01-22 20:55:35 +00:00
Douglas Gregor 562c1f9365 Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
  - Extend Preprocessor::getLocForEndOfToken() to accept an offset
  from the end, making it easy to move to the last character in the
  token (rather than just past the end of the token).
  - In Lexer::MeasureTokenLength(), the length of whitespace is zero.

llvm-svn: 94200
2010-01-22 19:49:59 +00:00
Zhongxing Xu a1293a67cd Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.

llvm-svn: 94153
2010-01-22 04:30:00 +00:00
Daniel Dunbar 7cde09ac8a Driver/Darwin: Update tool chain to use static clang_rt libraries provided by
compiler-rt. This tool chain now works on x86 and ARM, but isn't the x86 default
yet. 

This drastically cleans up the linker invocation, old invocation:
--
"/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "t.o" "-lSystem" "-lgcc"
--

New invocation:
--
# For 10.6:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "t.o" "-lSystem"
# For 10.4:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.4" "-o" "a.out" "-lcrt1.o" "t.o" "-lSystem" "-lgcc_s.10.4" "/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib/clang/1.1/lib/darwin/libclang_rt.10.4.a"
--

llvm-svn: 94150
2010-01-22 03:38:14 +00:00
Douglas Gregor d824f8825b Teach the cursor visitor to walk all of the C and Objective-C
declarations that have enough source information to make such a walk
useful. This includes walking into variable initializers and enum
constants, the types behind typedefs, etc.

llvm-svn: 94124
2010-01-22 00:50:27 +00:00
Chris Lattner fde85356c6 revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

llvm-svn: 94120
2010-01-22 00:14:44 +00:00
John McCall 1848ea4fe3 Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.

llvm-svn: 94109
2010-01-21 22:59:41 +00:00
Mike Stump fcd6f94ba7 Improve unreachable code warnings for with respect to dead functional casts in C++.
llvm-svn: 94106
2010-01-21 22:12:18 +00:00
Ted Kremenek 819e873791 Allocate the 'Protocols' array in ObjCInterfaceType and
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).

llvm-svn: 94090
2010-01-21 19:22:34 +00:00
Fariborz Jahanian e344e41fed Fixes a comment.
llvm-svn: 94088
2010-01-21 17:39:43 +00:00
Fariborz Jahanian da8ec2bc9e Patch to implement rewriting of properties.
Fixes radar 7562952.

llvm-svn: 94087
2010-01-21 17:36:00 +00:00
Douglas Gregor 93f899509d Introduce type references into the C API, capturing references to
typedefs only (for now).

llvm-svn: 94078
2010-01-21 16:28:34 +00:00
Mike Stump 04c6851cd6 Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls.  Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges.  All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.

llvm-svn: 94074
2010-01-21 15:20:48 +00:00
Mike Stump 6bf1c08e99 Add infrastructure to add base initializers and member initializers to
the CFG.  WIP.

llvm-svn: 94062
2010-01-21 02:21:40 +00:00
Douglas Gregor fed36b1aa1 Stash a CXXUnit pointer into each cursor. This allows us to simplify
the interface to clang_visitChildren() by eliminating the
CXTranslationUnit pointer.

llvm-svn: 94051
2010-01-20 23:57:43 +00:00
Douglas Gregor c8e390c215 Yet more Doxygen-comment tweaking in the CIndex library.
llvm-svn: 94044
2010-01-20 22:45:41 +00:00
Douglas Gregor 802f12f719 Improve Doxygen documentation for the CIndex library, somewhat.
llvm-svn: 94042
2010-01-20 22:28:27 +00:00
John McCall 97c5a140c2 Change LLVM/clang #includes to use quotes, not angle-brackets. Just a think-o
prompted by the #include <iterator> above.

llvm-svn: 94040
2010-01-20 22:16:29 +00:00
Douglas Gregor 721e82edbc Kill CXEntity and CXDecl. The first has never been used, while the
second has been wholly replaced by cursors.

llvm-svn: 94039
2010-01-20 22:14:22 +00:00
John McCall 401982f56c First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information;  fix them.

Will actually consume this information soon.

llvm-svn: 94038
2010-01-20 21:53:11 +00:00
Douglas Gregor dd969c897e Kill some CXDecl-related APIs that have been superceded by
CXCursor-based APIs.

llvm-svn: 94037
2010-01-20 21:45:58 +00:00
Douglas Gregor 2582af00d4 Kill CXStmt. It isn't being used anywhere, and has no future.
llvm-svn: 94036
2010-01-20 21:38:07 +00:00
Douglas Gregor 990b576ec8 Kill clang_loadDeclaration() and clang_loadTranslationUnit().
llvm-svn: 94034
2010-01-20 21:37:00 +00:00
Daniel Dunbar 73118e6d82 Use sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!
llvm-svn: 94024
2010-01-20 21:13:31 +00:00
Douglas Gregor 71f3d94391 Introduce a new, cursor-based traversal function that visits the
children of a given cursor, regardless of what kind of cursor it
is. This is a generalization of clang_loadDeclaration and
clang_loadTranslationUnit that will also extent to statements,
expressions, etc.

As proof-of-concept, switched clang_loadDeclaration() from its own
visitor over to an instance of this traversal function internally.

llvm-svn: 94022
2010-01-20 20:59:29 +00:00
Fariborz Jahanian 4f8a57112f Settled rule on warning on unimplemented property in
category implementation when some implementations
are missing in the primary class implementation.
(fixes radar 6505200).

llvm-svn: 94014
2010-01-20 19:36:21 +00:00
Chris Lattner 6a89c50e23 reduce redundant are's
llvm-svn: 94009
2010-01-20 17:53:58 +00:00
Chandler Carruth 4d9517c564 Fix a typo pointed about by gabor.
llvm-svn: 93997
2010-01-20 07:43:54 +00:00
Chandler Carruth 26b29a0892 Move the MacroBuilder utilitiy to its own header. Update references.
Comments and/or improvements to the documentation are welcome.

llvm-svn: 93982
2010-01-20 06:13:02 +00:00
Chandler Carruth b0af340592 Fix a layering issue between Basic and FE by moving a utility class into Basic.
This isn't entirely satisfactory, as it seems an implementation detail, and
with nothing to do with TargetInfo. Suggestions on where to put this are
welcome.

llvm-svn: 93974
2010-01-20 03:59:11 +00:00
Daniel Dunbar 3f3e2cd820 Driver: Lift clang resource directory computation to the Driver object.
llvm-svn: 93971
2010-01-20 02:35:16 +00:00
John McCall 1bcb2631e6 Make UnresolvedSet.h standalone.
llvm-svn: 93964
2010-01-20 01:36:13 +00:00
Douglas Gregor 52606ff2ca Attempt to improve CIndex Doxygen organization, although I can't actually test this locally
llvm-svn: 93961
2010-01-20 01:10:47 +00:00
John McCall ad371258aa Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet.  Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.

llvm-svn: 93959
2010-01-20 00:46:10 +00:00
Douglas Gregor 9074c3fe97 Kill off clang_getDeclColumn, clang_getDeclExtent, clang_getDeclLine,
clang_getDeclSource, and clang_getDeclSourceFile; the cursor
equivalents are the way of the future.

llvm-svn: 93955
2010-01-20 00:26:57 +00:00
Douglas Gregor d2fc7277be Introduce a special cursor kind for the translation unit, to serve as
the root of the conceptual cursor hierarchy (just like we do with
declarations). This will be used when we get to unify
clang_loadTranslationUnit() and clang_loadDeclaration() into something
more generally useful.

llvm-svn: 93954
2010-01-20 00:23:15 +00:00
Douglas Gregor c0943d089f CXCursor_UnexposedDecl to the first declaration kind
llvm-svn: 93952
2010-01-20 00:07:45 +00:00
Douglas Gregor 084236fafd Kill CXCursor_ObjCSelectorRef, CXCursor_VarRef, CXCursor_FunctionRef,
and CXCursor_EnumConstantRef; they've been subsumed by expression
references, which do a much nicer job.

llvm-svn: 93947
2010-01-19 23:25:01 +00:00
Douglas Gregor 8f40bbee78 Extend the CIndex API with direct support for expressions and
statements, moving some of the more unnatural kinds of references
(VarRef, EnumConstantRef, etc.) over to the expressions. We can now
poke at arbitrary expressions and statements with, e.g.,
clang_getCursor() and get back useful information (e.g., source
ranges).

llvm-svn: 93946
2010-01-19 23:20:36 +00:00
Mike Stump 314825bc8a Implement goto inside of blocks.
llvm-svn: 93945
2010-01-19 23:08:01 +00:00
John McCall 5d7aa7fa0a The type of a compound literal expression is not necessarily the same as the
type which was syntactically written.  Fixes PR 6080.

llvm-svn: 93933
2010-01-19 22:33:45 +00:00
Douglas Gregor 7d1efeb43d Kill the unused and unnecessary CXCursor_MemberRef, twin to the
now-dead CXCursor_ObjCIvarRef.

llvm-svn: 93928
2010-01-19 22:15:34 +00:00
Douglas Gregor 015026e358 Kill CXCursor_ObjCIvarRef. Such cursors could never be created, and
have been marked for death for a while.

llvm-svn: 93927
2010-01-19 22:11:32 +00:00
Douglas Gregor accb183371 Introduce the notion of an "unexposed" declaration into the CIndex
API. This is a catch-all for any declaration known to Clang but not
specifically part of the CIndex API. We'll use the same approach with
expressions, statements, references, etc., as needed.

llvm-svn: 93924
2010-01-19 22:07:56 +00:00
Mike Stump 92244b00c7 Add CFG support for the start and end of scopes and infrastructure for
implicit destructor calls.  WIP.

llvm-svn: 93922
2010-01-19 22:00:14 +00:00
Douglas Gregor 4f46e789b3 Rework the CXSourceLocation and CXSourceRange APIs. They are now
opaque data structures accessed through the new functions
clang_getInstantiationLocation(), clang_getRangeStart(), and
clang_getRangeEnd(). The new API permits later extensions to introduce
new functions to allow CIndex clients to walk macro instantiations, if
we ever care.

llvm-svn: 93915
2010-01-19 21:36:55 +00:00
Douglas Gregor 6b8232ff82 Eliminate cursor kinds used to express definitions. Instead, provide
CIndex functions that (1) map from a reference or declaration to the
corresponding definition, if available, and (2) determine whether a
given declaration cursor is also a definition. This eliminates a lot
of duplication in the cursor kinds, and maps more closely to the Clang
ASTs.

This is another API + ABI breaker with no deprecation. Yay, progress.

llvm-svn: 93893
2010-01-19 19:34:47 +00:00
Zhongxing Xu cd17954dbe Fix a serious bug: Tmp3 is the wrong destination set. We should create a new
intermediate destination set Tmp4.

llvm-svn: 93873
2010-01-19 09:25:53 +00:00
Douglas Gregor ad27e8b777 Introduce clang_getCursorReferenced, to get a cursor pointing at the
entity that a particular cursor references.

llvm-svn: 93830
2010-01-19 01:20:04 +00:00
Douglas Gregor 33c34ac19a Implement clang_getCursorExtent, which provides a source range for the
cursor itself. In particular, for references this returns the source
range of the reference rather than the source range of the thing it
refers to.

Switch c-index-test from clang_getDeclExtent (which will eventually be
deprecated and removed) over to clang_getCursorExtent. The source
ranges we print for references now make sense; fix up the tests
appropriately.

llvm-svn: 93823
2010-01-19 00:34:46 +00:00
John McCall 62e2066792 Move AccessSpecifier into the new Specifiers.h; fixes the layering violations
inherent in, well, pretty much every use of AccessSpecifier.

llvm-svn: 93804
2010-01-18 23:21:37 +00:00
Douglas Gregor 3338c1f5d2 Now that a reasonable deprecation cycle has passed, kill
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile() outright.

llvm-svn: 93801
2010-01-18 22:48:04 +00:00
Douglas Gregor 66a58819d1 Introduce clang_getCursorLocation(), which supercedes
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile(). Mark those 4
functions as deprecated and stop using them ourselves.

llvm-svn: 93800
2010-01-18 22:46:11 +00:00
Chris Lattner 87d0208c41 allow the HandlerComment callback to push tokens into the
preprocessor.  This could be used by an OpenMP implementation
or something.  Patch by Abramo Bagnara!

llvm-svn: 93795
2010-01-18 22:35:47 +00:00
Douglas Gregor 49c4baf430 Clean up the CIndex API slightly.
Renamed CXSourceFileLine to CXSourceLocation and added a CXFile, to
better match Clang's SourceLocation. Teach clang_getDeclExtent to fill
in the CXFile properly.

Renamed CXSourceExtent to CXSourceRange, to better match Clang's
SourceLocation.

llvm-svn: 93783
2010-01-18 22:13:09 +00:00
Daniel Dunbar c02aaa7812 Add missing newline.
llvm-svn: 93767
2010-01-18 20:55:52 +00:00