From 4a9a908739d7d7c833e7985ea7465d95c0dd0b82 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 2 Apr 2014 21:44:51 +0100 Subject: Tidy up code by using LLVM's V2 path API only and removing uses of old V1 path API. LLVM2.9 supports LLVM's V2 path API. Because that is the minimum version we support we should just use this API everywhere so we reduce the number of #if LLVM_VERSION_CODE macros and duplicated code. --- lib/Module/KModule.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/Module') diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 5f03728b..e06e722a 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -375,19 +375,16 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, // FIXME: Find a way that we can test programs without requiring // this to be linked in, it makes low level debugging much more // annoying. -#if LLVM_VERSION_CODE >= LLVM_VERSION(3,4) + SmallString<128> LibPath(opts.LibraryDir); - llvm::sys::path::append(LibPath, "kleeRuntimeIntrinsic.bc"); - module = linkWithLibrary(module, LibPath.str()); -#else - llvm::sys::Path path(opts.LibraryDir); -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3) - path.appendComponent("kleeRuntimeIntrinsic.bc"); + llvm::sys::path::append(LibPath, +#if LLVM_VERSION_CODE >= LLVM_VERSION(3,3) + "kleeRuntimeIntrinsic.bc" #else - path.appendComponent("libkleeRuntimeIntrinsic.bca"); -#endif - module = linkWithLibrary(module, path.c_str()); + "libkleeRuntimeIntrinsic.bca" #endif + ); + module = linkWithLibrary(module, LibPath.str()); // Add internal functions which are not used to check if instructions // have been already visited -- cgit 1.4.1