clang-pure 0.2.0.5 → 0.2.0.6
raw patch · 5 files changed
+17/−1 lines, 5 filessetup-changedPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Language.C.Clang.Cursor: cursorLocation :: Cursor -> SourceLocation
+ Language.C.Clang.Cursor.Typed: cursorLocation :: CursorK kind -> SourceLocation
Files
- Setup.hs +2/−0
- clang-pure.cabal +1/−1
- src/Language/C/Clang/Cursor.hs +1/−0
- src/Language/C/Clang/Cursor/Typed.hs +4/−0
- src/Language/C/Clang/Internal/FFI.hsc +9/−0
Setup.hs view
@@ -113,6 +113,8 @@ return $ \libBuildInfo -> libBuildInfo { includeDirs = llvmIncludeDir : includeDirs libBuildInfo , extraLibDirs = llvmLibraryDir : extraLibDirs libBuildInfo+ -- Set the RPATH so the Clang libs can be found later.+ , ldOptions = ("-Wl,-rpath," ++ llvmLibraryDir) : ldOptions libBuildInfo } let Just lib = library pd
clang-pure.cabal view
@@ -1,5 +1,5 @@ name: clang-pure-version: 0.2.0.5+version: 0.2.0.6 synopsis: Pure C++ code analysis with libclang description: Pure C++ code analysis with libclang.
src/Language/C/Clang/Cursor.hs view
@@ -31,6 +31,7 @@ , cursorDescendants , cursorSpelling , cursorExtent+ , cursorLocation , cursorUSR , cursorReferenced , cursorType
src/Language/C/Clang/Cursor/Typed.hs view
@@ -27,6 +27,7 @@ , cursorDescendants , cursorExtent+ , cursorLocation , cursorSpelling @@ -94,6 +95,9 @@ cursorExtent :: HasExtent kind => CursorK kind -> SourceRange cursorExtent = fromJust . UT.cursorExtent . withoutKind++cursorLocation :: CursorK kind -> SourceLocation+cursorLocation = UT.cursorLocation . withoutKind class HasSpelling (kind :: CursorKind)
src/Language/C/Clang/Internal/FFI.hsc view
@@ -213,6 +213,15 @@ return ( srp, free srp ) return $ Just $ SourceRange srn +cursorLocation :: Cursor -> SourceLocation+cursorLocation c = uderef c $ \cp -> do+ slp <- [C.exp| CXSourceLocation* { ALLOC(+ clang_getCursorLocation(*$(CXCursor *cp))+ )} |]+ sln <- newLeaf (cursorTranslationUnit c) $ \_ ->+ return ( slp, free slp )+ return $ SourceLocation sln+ cursorUSR :: Cursor -> ByteString cursorUSR c = uderef c $ \cp -> withCXString $ \cxsp -> [C.block| void {