[libclc] 17/21: Move BufferPtr into the block where it it being used

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Feb 13 13:58:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 8d720210222df9fc86d8eb0ab4d241b853497eb4
Author: Jeroen Ketema <j.ketema at imperial.ac.uk>
Date:   Sun Feb 12 21:33:49 2017 +0000

    Move BufferPtr into the block where it it being used
    
    The previous location outside the block would crash prepare-builtins
    when no the builtins file accidentially not passed on the command line.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@294916 91177308-0d34-0410-b5e6-96231b3b80d8
---
 utils/prepare-builtins.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index c8b1f44..882dadd 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -36,10 +36,10 @@ int main(int argc, char **argv) {
   {
     ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
       MemoryBuffer::getFile(InputFilename);
-    std::unique_ptr<MemoryBuffer> &BufferPtr = BufferOrErr.get();
-    if (std::error_code  ec = BufferOrErr.getError())
+    if (std::error_code  ec = BufferOrErr.getError()) {
       ErrorMessage = ec.message();
-    else {
+    } else {
+      std::unique_ptr<MemoryBuffer> &BufferPtr = BufferOrErr.get();
       ErrorOr<std::unique_ptr<Module>> ModuleOrErr =
           expectedToErrorOrAndEmitErrors(Context,
           parseBitcodeFile(BufferPtr.get()->getMemBufferRef(), Context));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list